Skip to main content

Method

The sdk.method utility allows you to call backend Meteor server methods directly from a Custom Function. These methods are part of GridStudio's internal API and can be used to fetch data, trigger backend logic, or access business-specific operations.

All method calls are asynchronous and return a Promise.

tip

For a list of available server methods, please contact the GridStudio support team.


API

sdk.method({ name }).callAsync({ payload })

ParameterTypeDescription
namestringFully-qualified method name to be called.
payloadobjectOptional payload passed as the method input.

If payload.slug is not manually provided, the current tenant slug will be injected automatically.


Example

const result = await sdk.method({ name: 'business.tenants.team.agents.list' }).callAsync({
payload: {
options: {
pagination: { currentPage: 1, pageItems: 20 },
filtering: { keyword: 'john' },
},
},
})

const agentUsers = result?.agents

Notes

  • Make sure to use the exact method name as registered on the server.
  • Errors during method calls are caught and displayed automatically.
  • This is ideal for accessing business logic that doesn’t require a custom function wrapper.