Users

The Syncd SDK offers the most flexibility for integrating with the Figma API directly in your codebase.

Overview

Syncd’s SDK allows you to create, update, and delete webhooks for your users. This means we abstract all the complexity of dealing with 3rd party API’s and provide you with a simple interface to interact with them.

Note: each customer can have multiple webhooks. You will need to store the ID’s of each endpoint we return on every request. This will be how you preform CRUD operations the webhook in the future.

Get Users Webhooks

The Syncd JS SDK provides a simple strongly typed way of interacting with your users webhooks/data. Here’s an example of how you can use the SDK to create a webhook for a user:

await syncdClient.users.webhooks.retrieveAll({
  projectId,
});

or with filters…

await syncdClient.users.webhooks.retrieve({
  where: {
    provider: "FIGMA", // This is fully typed
    // or just
    id: "webhookId", // this you get when you first create a webhook
  },
});

Note: If you want to update a users webhook, you must use the provider specifice endpoint. For example:

await syncdClient.providers.figma.webhooks.update({
    ...
})

If you want to update a webhook check out our providers page.