-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
101 changed files
with
398 additions
and
436 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 100, | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"tabWidth": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 30 additions & 30 deletions
60
_snippets/typescript-sdk/add-customer-to-group-response.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
```ts /c_XXXXXXXXXXXXXXXXXXXXXXXXXX/ | ||
import { AttachmentType, PlainClient } from "@team-plain/typescript-sdk"; | ||
import { AttachmentType, PlainClient } from '@team-plain/typescript-sdk'; | ||
|
||
const client = new PlainClient({ apiKey: "XXX" }); | ||
const client = new PlainClient({ apiKey: 'XXX' }); | ||
|
||
const res = await client.createAttachmentUploadUrl({ | ||
customerId: "c_XXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
fileName: "the-filename.jpeg", | ||
customerId: 'c_XXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
fileName: 'the-filename.jpeg', | ||
fileSizeBytes: 32318, | ||
attachmentType: AttachmentType.CustomTimelineEntry, | ||
}); | ||
|
||
if (res.error) { | ||
console.error(res.error); | ||
} else { | ||
console.log("Attachment upload url created"); | ||
console.log('Attachment upload url created'); | ||
console.log(res.data); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
```tsx | ||
import { PlainClient, uiComponent } from "@team-plain/typescript-sdk"; | ||
import { PlainClient, uiComponent } from '@team-plain/typescript-sdk'; | ||
|
||
const client = new PlainClient({ | ||
apiKey: "XXX", | ||
apiKey: 'XXX', | ||
debug: true, | ||
}); | ||
|
||
const res = await client.createCustomerEvent({ | ||
title: "API key generated", | ||
title: 'API key generated', | ||
|
||
customerIdentifier: { | ||
// You can use the email: | ||
email: "[email protected]", | ||
email: '[email protected]', | ||
|
||
// ...or if you set external id on customers: | ||
// externalId: 'YOUR_ID', | ||
|
@@ -22,26 +22,26 @@ const res = await client.createCustomerEvent({ | |
|
||
components: [ | ||
uiComponent.text({ | ||
text: "New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.", | ||
text: 'New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.', | ||
}), | ||
uiComponent.spacer({ | ||
size: "M", | ||
size: 'M', | ||
}), | ||
uiComponent.linkButton({ | ||
label: "View in admin", | ||
url: "https://admin.your-app.com", | ||
label: 'View in admin', | ||
url: 'https://admin.your-app.com', | ||
}), | ||
], | ||
|
||
// Optional - if provided, this will ensure that this event can only | ||
// be created once and fail on the second time. This external id acts | ||
// as an idempotency key while also letting you correlate an event to | ||
// something your systems. | ||
externalId: "XXX", | ||
externalId: 'XXX', | ||
|
||
// Optional - if provided then the event will only be shown | ||
// in a single thread vs all threads from a customer | ||
threadId: "th_01HB924RWAW8H3Q8KZDFWYBJHZ", | ||
threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ', | ||
}); | ||
|
||
if (res.error) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
```tsx | ||
import { PlainClient } from "@team-plain/typescript-sdk"; | ||
import { PlainClient } from '@team-plain/typescript-sdk'; | ||
|
||
const client = new PlainClient({ | ||
apiKey: "XXX", | ||
apiKey: 'XXX', | ||
debug: true, | ||
}); | ||
|
||
const res = await client.createThread({ | ||
title: "Bug Report", | ||
title: 'Bug Report', | ||
customerIdentifier: { | ||
// You can use the email: | ||
email: "[email protected]", | ||
email: '[email protected]', | ||
|
||
// ...or if you set external id on customers: | ||
// externalId: '', | ||
|
@@ -27,7 +27,7 @@ const res = await client.createThread({ | |
], | ||
// Label types are created in settings where you can also copy | ||
// their ID. | ||
labelTypeIds: ["lt_01HB924PME9C0YWKW1N4AK3BZA"], | ||
labelTypeIds: ['lt_01HB924PME9C0YWKW1N4AK3BZA'], | ||
}); | ||
|
||
if (res.error) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
```tsx {21} | ||
import { PlainClient } from "../client"; | ||
import { PlainClient } from '../client'; | ||
|
||
export async function createCustomer() { | ||
const client = new PlainClient({ apiKey: "XXX" }); | ||
const client = new PlainClient({ apiKey: 'XXX' }); | ||
|
||
const res = await client.upsertCustomer({ | ||
identifier: { | ||
emailAddress: "[email protected]", | ||
emailAddress: '[email protected]', | ||
}, | ||
onCreate: { | ||
fullName: "Jane Fargate", | ||
fullName: 'Jane Fargate', | ||
email: { | ||
email: "[email protected]", | ||
email: '[email protected]', | ||
isVerified: true, | ||
}, | ||
}, | ||
|
Oops, something went wrong.