Authentication ๐Ÿ”

Keep your workflows secure with simple bearer token authentication. Let's get you set up!

Bearer Token Authentication

Getting started is super easy! All you need is your access token in the Authorization header. Grab your token from the Graph Compose dashboard and you're ready to go:

Example request with bearer token

curl https://api.graphcompose.io/workflows \
  -H "Authorization: Bearer {key}"

๐Ÿ’ก Pro tip: Always keep your token secure and rotate it if you think it might be compromised.

Using the SDK โœจ

Authenticating with the @graph-compose/client package is straightforward.

Environment Variable (Recommended)

The most common way is to store your token in an environment variable (e.g., GRAPH_COMPOSE_TOKEN) and pass it during client initialization:

Setting the environment variable

export GRAPH_COMPOSE_TOKEN=your_token_here

SDK initialization reading from environment variable

import { GraphCompose } from '@graph-compose/client'

// Read the token from the environment variable
const client = new GraphCompose({
  token: process.env.GRAPH_COMPOSE_TOKEN
})

Explicit Initialization

Alternatively, you can pass your token string directly:

SDK initialization with explicit token string

import { GraphCompose } from '@graph-compose/client'

const client = new GraphCompose({
  token: 'your_token_here'
})

Best Practices ๐Ÿ’ก

Keep your tokens safe and sound:

  • ๐Ÿšซ Never commit tokens to version control
  • ๐ŸŒ Use environment variables in production
  • ๐Ÿ”„ Rotate tokens regularly
  • ๐Ÿ‘ฅ Update tokens when team members change
  • โšก Set proper permissions in the dashboard

Ready to start building? Let's go! ๐Ÿš€