What is an Identity Token?

You can think of individual Identity Tokens as instances of an Identity on Standard Library.

When you associate Linked Resources (things like Airtable bases, Slack apps, Google Sheets spreadsheets, or Stripe accounts) with an Identity, you securely store credentials for those resources in an Identity. You can then use an Identity Token to use those stored credentials to interact with the resources (think making API calls, receiving events).

For example, the example below calls the messages.create endpoint within the slack/channels API on Standard Library while passing in an Identity Token. If that token has a linked Slack app, this call will use a stored Slack OAuth token to create a message from that app to the #general channel within the app's Slack workspace. Unlinking the Slack app would detach the app from the Identity, which means making the call again will result in an error.

const lib = require('lib')({token: <your Identity Token value>});

let result = await lib.slack.channels.messages.create({
  channel: '#general',
  text: 'Aloha from Standard Library!'
It is extremely important to keep the value of your Identity Token secret.

Anyone with this value will have access to any resources you link to the Identity. If you suspect that the value of your Identity Token has fallen into the wrong hands, you should delete the token immediately by navigating to the Identity Tokens page on Build. You can then create a new Identity Token with a new value and relink the appropriate Linked Resources.