@bearer/functions
v1.13.9
Published
Bearer Functions
Downloads
216
Keywords
Readme
@bearer/functions
Usage
Creating a FetchData function
import { FetchData, TOAUTH2AuthContext } from '@bearer/functions'
import Client from './client'
export default class FunctionName extends FetchData implements FetchData<ReturnedData, any, TOAUTH2AuthContext> {
// Uncomment the line above if you don't want your function to be called from the frontend
// static serverSideRestricted = true
async action(event: TFetchActionEvent<Params, TOAUTH2AuthContext>): TFetchPromise<ReturnedData> {
// const token = event.context.auth.accessToken
// Put your logic here
return { data: [] }
}
}
export type Params = {
// name: string
}
export type ReturnedData = {
// foo: string[]
}