Skip to content

Commit bc4dbed

Browse files
authored
Merge pull request #32 from hgraph-io/hg-256/readme_fixes
HG-256 Test commands in Hgraph SDK README
2 parents ae2b05e + ba3e7c3 commit bc4dbed

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ To interact with Hgraph's services, you'll need to authenticate your requests. T
2727
To authenticate using an API key, include your API key in the `x-api-key header` of each request. Here's how you can set it up:
2828

2929
```javascript
30-
const hgraph = new HGraphSDK({
30+
import HgraphSDK from '@hgraph.io/sdk';
31+
32+
const hgraph = new HgraphSDK({
3133
headers: {
3234
'x-api-key': 'your-api-key-here',
3335
},
@@ -41,17 +43,17 @@ For enhanced security, especially in front-end applications, we are rolling out
4143
Learn more about JWTs at [jwt.io](https://jwt.io/).
4244

4345
:::note Early access
44-
JWT authentication is in the early access phase. If you're interested in implementing this method, please [reach out to support](/support) for assistance.
46+
JWT authentication is in the early access phase. If you're interested in implementing this method, please [reach out to support](https://docs.hgraph.com/support) for assistance.
4547
:::
4648

4749
##### Example usage
4850

4951
Once you have your JWT, you can authenticate your requests as follows:
5052

5153
```javascript
52-
import HGraphSDK from '@hgraph.io/sdk';
54+
import HgraphSDK from '@hgraph.io/sdk';
5355

54-
const hgraph = new HGraphSDK({
56+
const hgraph = new HgraphSDK({
5557
headers: {
5658
Authorization: `Bearer your-jwt-token-here`,
5759
},
@@ -139,10 +141,10 @@ To test the WebSocket connection and ensure that everything is set up correctly,
139141
Replace `<YOUR_API_KEY>` with your actual API key and run:
140142

141143
```bash
142-
wscat -s 'graphql-ws' -H 'x-api-key: <YOUR_API_KEY>' -c wss://api.hgraph.dev/v1/graphql
144+
wscat -s 'graphql-ws' -H 'x-api-key: <YOUR_API_KEY>' -c wss://testnet.hedera.api.hgraph.dev/v1/graphql
143145
```
144146

145-
This command initiates a WebSocket connection to the GraphQL endpoint at `wss://api.hgraph.dev/v1/graphql` using your API key for authentication.
147+
This command initiates a WebSocket connection to the GraphQL endpoint at `wss://testnet.hedera.api.hgraph.dev/v1/graphql` using your API key for authentication.
146148

147149
**Note:** If you don't have `wscat` installed, you can install it globally using:
148150

@@ -154,4 +156,4 @@ npm install -g wscat
154156

155157
This Software Development Kit (SDK) is actively being developed in conjunction with the [Hgraph API](https://hgraph.com) to ensure seamless integration and compatibility between the two. We are committed to adopting [Semantic Versioning](https://semver.org) standards, which will provide clear and predictable updates, making it easier for developers to manage dependencies and stay informed about changes.
156158

157-
> Before we release version 1.0, updates may introduce breaking changes as we refine the software. To maintain stability in production, we recommend pinning dependencies to an exact version using `--save-exact` when installing the package.
159+
> Before we release version 1.0, updates may introduce breaking changes as we refine the software. To maintain stability in production, we recommend pinning dependencies to an exact version using `--save-exact` when installing the package.

0 commit comments

Comments
 (0)