Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pages/lazer/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"type": "separator"
},

"acquire-access-token": "Acquire an Access Token",
"subscribe-price-updates": "Subscribe to Price Updates",
"integrate-as-consumer": "Integrate as a Consumer",
"integrate-as-publisher": "Integrate as a Publisher",
Expand Down
33 changes: 33 additions & 0 deletions pages/lazer/acquire-access-token.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Callout } from "nextra/components";

# Acquire an Access Token

This guide explains how to acquire an access token for Pyth Lazer, which is required to authenticate websocket connections and subscribe to price updates.

## Request Access Token

Please fill out [this form](https://tally.so/r/nP2lG5) to contact the Pyth team and get the access token.

<Callout type="info">
Access tokens are required for all Pyth Lazer websocket connections. Make sure
to keep your token secure and do not share it publicly.
</Callout>

## Using the Access Token

Once you receive your access token, use it to authenticate the websocket connection by passing it as an `Authorization` header with the value `Bearer {token}`.

### Example Usage

```js copy
import { PythLazerClient } from "@pythnetwork/pyth-lazer-sdk";

const client = await PythLazerClient.create(
["wss://pyth-lazer.dourolabs.app/v1/stream"],
"YOUR_ACCESS_TOKEN"
);
```

## Next Steps

After acquiring your access token, you can proceed to [subscribe to price updates](./subscribe-price-updates.mdx) using the Pyth Lazer websocket API.
Loading