@trycourier/client-graphql
Advanced tools
Comparing version 1.17.1-internal.ba2edf7.0 to 1.18.1-internal.184b35c.0
@@ -19,3 +19,2 @@ "use strict"; | ||
headers = { | ||
"x-courier-client-key": params.clientKey, | ||
authorization: "Bearer ".concat(params.authorization) | ||
@@ -22,0 +21,0 @@ }; |
{ | ||
"name": "@trycourier/client-graphql", | ||
"version": "1.17.1-internal.ba2edf7.0+ba2edf7", | ||
"version": "1.18.1-internal.184b35c.0+184b35c", | ||
"description": "", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
], | ||
"gitHead": "ba2edf785c16549ee4cd6dd50d688cb8e9fa9c76" | ||
"gitHead": "184b35c61ad69bf845b791d968db9763af6ad576" | ||
} |
@@ -17,5 +17,13 @@ ## Courier Client GraphQl | ||
or you can create the client separtly and pass the client in: | ||
Or alternately, you can use an issued [authorization token](https://www.courier.com/docs/reference/auth/issue-token/). | ||
``` | ||
{ | ||
authorization: string; | ||
} | ||
``` | ||
You can also create the client separately and pass the client in: | ||
``` | ||
import { createCourierClient } from "@trycourier/client-graphql"; | ||
@@ -36,7 +44,5 @@ const courierClient = createCourierClient({ | ||
import { Messages } from "@trycourier/client-graphql"; | ||
const messagesApi = Messages({ | ||
clientKey: "abc123", | ||
userId: "@me", | ||
userSignature: "SUPER_SECRET", | ||
}); | ||
const messagesApi = Messages({ authorization: "abc123" }); | ||
const getMessageCount = async (params?: { | ||
@@ -112,10 +118,7 @@ isRead?: boolean, | ||
#### For > 1 user | ||
#### With JWT (Supports multiple users) | ||
```js | ||
import { Banner } from "@trycourier/client-graphql"; | ||
const bannerApi = Banner({ | ||
clientKey: "abc123", | ||
authorization: "MY JWT TOKEN", | ||
}); | ||
const bannerApi = Banner({ authorization: "MY JWT TOKEN" }); | ||
const getBanners = async (params?: { tags?: string[], locale?: string }) => { | ||
@@ -122,0 +125,0 @@ const myBanners = await bannerApi.getBanners(params); |
@@ -12,3 +12,4 @@ import { Client } from "urql"; | ||
authorization: string; | ||
clientKey: string; | ||
/** @deprecated (Not needed for JWT auth) */ | ||
clientKey?: string; | ||
apiUrl?: string; | ||
@@ -23,5 +24,6 @@ }; | ||
export declare type CourierJWTHeaders = RequestInit["headers"] & { | ||
"x-courier-client-key": string; | ||
authorization: string; | ||
/** @deprecated (Not needed for JWT auth) */ | ||
"x-courier-client-key"?: string; | ||
}; | ||
//# sourceMappingURL=types.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
38228
620
126