@bearer/functions
TypeScript icon, indicating that this package has built-in type declarations

1.13.9 • Public • Published

@bearer/functions

Version npm bundle size (scoped) Downloads/week License

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[]
}

Readme

Keywords

none

Package Sidebar

Install

npm i @bearer/functions

Weekly Downloads

3

Version

1.13.9

License

MIT

Unpacked Size

51.7 kB

Total Files

18

Last publish

Collaborators

  • cfabianski
  • qrczeno
  • bearer-engineering-ci-cd
  • gotbadger