Skip to content

Commit 3f56252

Browse files
committed
change insight auth in docs (#5681)
## Problem solved https://linear.app/thirdweb/issue/INSIGHT-480/improvements-required-for-insight-playground Updated the authentication method in the Insight API documentation to use the `x-client-id` header instead of embedding the client ID in the URL path. <!-- start pr-codex --> --- ## PR-Codex overview This PR updates the GitHub workflow and documentation related to the `insight` feature. It enhances the valid issue prefixes and provides clearer instructions for authentication in the API usage. ### Detailed summary - Updated `VALID_ISSUE_PREFIXES` to include `INSIGHT`. - Improved documentation in `apps/portal/src/app/insight/get-started/page.mdx`: - Corrected "clientId" to "client ID". - Added a note about using the `x-client-id` header for authentication. - Modified the API fetch request to include headers for `client ID`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent a9dd26c commit 3f56252

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened, edited]
66

77
env:
8-
VALID_ISSUE_PREFIXES: "CNCT|DASH|PROT"
8+
VALID_ISSUE_PREFIXES: "CNCT|DASH|PROT|INSIGHT"
99

1010
jobs:
1111
linear:

apps/portal/src/app/insight/get-started/page.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ In this guide we will learn how to use the events blueprint in insight.
1616

1717
## Pre-requisites
1818

19-
- [Create a project](https://thirdweb.com/team) and navigate to the project settings to get a clientId
20-
- Use insight API with the base URL below
19+
- [Create a project](https://thirdweb.com/team) and navigate to the project settings to get a client ID
20+
- Use insight API with the base URL below.
21+
- To authenticate use your client ID in the `x-client-id` header or `clientId` query parameter
2122

2223
```
2324
https://<chain-id>.insight.thirdweb.com
@@ -27,7 +28,11 @@ https://<chain-id>.insight.thirdweb.com
2728
```typescript
2829
const getUsdtTransfers = async () => {
2930
try {
30-
const response = await fetch('https://1.insight.thirdweb.com/v1/<client-id>/events/0xdAC17F958D2ee523a2206206994597C13D831ec7/Transfer(address,address,uint256)?limit=5');
31+
const response = await fetch('https://1.insight.thirdweb.com/v1/events/0xdAC17F958D2ee523a2206206994597C13D831ec7/Transfer(address,address,uint256)?limit=5', {
32+
headers: {
33+
'x-client-id': <YOUR_THIRDWEB_CLIENT_ID>
34+
}
35+
});
3136
const transfersInfo = await response.json();
3237
return transfersInfo
3338
} catch (error) {

0 commit comments

Comments
 (0)