@trycourier/client-graphql
Advanced tools
Comparing version 4.8.1-internal.7507a73.0 to 4.8.1-internal.bba30b1.0
{ | ||
"name": "@trycourier/client-graphql", | ||
"version": "4.8.1-internal.7507a73.0+7507a73", | ||
"version": "4.8.1-internal.bba30b1.0+bba30b1", | ||
"description": "", | ||
@@ -27,3 +27,3 @@ "main": "dist/index.js", | ||
], | ||
"gitHead": "7507a73ae5e816b511f7dba57a52affcfe0e0c06" | ||
"gitHead": "bba30b170671230f8ea901e4fc1fc0c7d96f3073" | ||
} |
@@ -99,2 +99,50 @@ ## Courier Client GraphQl | ||
### Preferences | ||
You can use our GraphQL endpoints to read and write advanced user preferences and see draft preferences. This API has getRecipientPreferences, getPreferencePage, getDraftPreferencePage, and updateRecipientPreferences methods. You can see the response payloads in action on [User Preference Tester](https://bwebs.github.io/courier-test/window-preferences.html) | ||
```js | ||
import { Preferences } from "@trycourier/client-graphql"; | ||
const preferencesApi = Preferences({ | ||
clientKey: "abc123", | ||
userId: "@me", | ||
userSignature: "SUPER_SECRET", | ||
}); | ||
const getRecipientPreferences = async (tenantId?: string) => { | ||
const user_preferences = await preferencesApi.getRecipientPreferences( | ||
tenantId | ||
); | ||
return user_preferences; | ||
}; | ||
const getPreferencePage = async (tenantId?: string) => { | ||
const page_with_defaults = await preferencesApi.getPreferencePage(tenantId); | ||
return page_with_defaults; | ||
}; | ||
const getDraftPreferencePage = async (tenantId?: string) => { | ||
const draft_page_with_defaults = await preferencesApi.getDraftPreferencePage( | ||
tenantId | ||
); | ||
return draft_page_with_defaults; | ||
}; | ||
const updateRecipientPreferences = async ( | ||
payload: UpdateRecipientPreferencesPayload | ||
) => { | ||
const update_preferences = await preferencesApi.updateRecipientPreferences( | ||
payload | ||
); | ||
return update_preferences; | ||
}; | ||
``` | ||
```ts | ||
interface UpdateRecipientPreferencesPayload { | ||
templateId: string; | ||
status: string; | ||
hasCustomRouting: boolean; | ||
routingPreferences: Array<string>; | ||
digestSchedule: string; | ||
tenantId?: string; | ||
} | ||
``` | ||
### Banners | ||
@@ -101,0 +149,0 @@ |
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
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
156350
174