Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
32 changes: 32 additions & 0 deletions pages/lazer/acquire-access-token.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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.
2 changes: 1 addition & 1 deletion pages/lazer/subscribe-price-updates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This guide explains how to subscribe to price updates from Pyth Lazer. This guid

Subscribing to price updates is a three-step process:

1. **Acquire** an access token.
1. **Acquire** an access token (see [Acquire an Access Token](./acquire-access-token.mdx)).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo this change

2. **Configure** subscription parameters.
3. **Subscribe** to the price updates via [websocket API](https://pyth-lazer.dourolabs.app/docs).

Expand Down
Loading