The Frigade JS SDK is a lightweight library that allows you to easily integrate Frigade into any stack that runs Javascript. Contrary to the React SDK, it is completely headless and does not come with any UI components. Instead, it provides a simple API that allows you to quickly build your own components powered by Frigade with any Javascript framework or library.

1

Install the JS SDK

Install the Frigade JS SDK using your favorite package manager:

npm install @frigade/js
2

Initialize the SDK

Simply import { Frigade } from '@frigade/js' and initialize the SDK with your public API key. You can find your API key in the Frigade dashboard on the “Developer” page.

import { Frigade } from '@frigade/js'

const frigade = new Frigade('FRIGADE_API_KEY')

await frigade.identify('USER_ID', {
  name: 'USER_NAME',
  email: 'USER_EMAIL',
  signed_up_at: 'USER_SIGNED_UP_AT' // ISO 8601 format
})

// Optional: send organization/group id
await frigade.group('ORGANIZATION_ID', {
  name: 'COMPANY_NAME',
})
3

Start using it

That’s pretty much it! You can now start using the Frigade JS SDK. Here’s how to get a Flow:

const flow = await frigade.getFlow('FLOW_ID')
console.log('Flow status:', flow.isCompleted)

Next steps

After getting the JS SDK up and running, we recommend taking a quick look at the JS SDK API documentation to get a better understanding of the available methods and how to use them.