Authentication
You can authenticate to the GraphQL API using an Access Token created on Levain Access Tokens.
Example of an access token:
lvp_PBCgj1wbIDAaFHF9Zf2ksbjv5SxzEewLpbXjw34df72C7ViB52
Access tokens are provisioned based on user-specific scopes. If you create an access token for your account, it will have access to all the resources to which your account has access.
Handle access tokens the same way you would treat your passwords or other sensitive credentials. For more information, see Storing access tokens securely
Authentication with Access Token
With the access token, you can authenticate to the GraphQL API by passing it as a Bearer token in the Authorization
header.
Examples
curl 'https://api.levain.tech/graphql' \
-H 'Authorization: Bearer lvp_replace_with_your_access_token' \
-H 'Content-Type: application/json' \
-d '{"query":"query { viewer { firstName } }"}'
Storing access tokens securely
Handle access tokens the same way you would treat your passwords or other sensitive credentials.
- Do not share access tokens through unencrypted messaging platforms or emails.
- Do not upload access tokens into any repository, even private ones. Utilise secure storage mechanisms (e.g., GitHub Action secrets).
- Do not enter access tokens as plain text in the command line.