- 09528f3: Update upsertCompany with contractValue arg
- 93c4bdb: Export missing status detail enums
- 58dfbc7: Added support for sending chats as a customer
sendCustomerChat
- 43677a3: Regenerate GraphQL Schema
- Allow labelTypeIds to be passed to
indexDocument
mutation
- Allow labelTypeIds to be passed to
- 640c6f1: expose tier default priority field
- 640c6f1: expose tier field on tenant
- ed3d92c: add tenant field to thread type
- f0849ed: new field added to User type
- 56a4508: Add support for indexing documents into Plain.
- d16ed41: Add ability to fetch a user by id (
userById()
)
- a7d1438: add __typename to all status details
- 9e0b2ba: Expose thread status details
- 695f962: Add support for getCustomerByExternalId
- 31da736: Updated graphql types to reflect new createdAt, updatedAt, statusChangedAt filters
- a4e365a: Fix a bug with webhook version mismatch detection
- a51fc80: Upgrade the SDK webhook parsing to support webhook version '2024-09-18'.
If your Plain webhook target is on the legacy/unversioned version, the SDK will no longer be able to parse the webhook payload. You must update your webhook target to '2024-09-18'. Refer to our docs for more information and instructions on how to safely upgrade your webhook target.
verifyPlainWebhook
method to verify the webhook signature, with support for replay attack protection, and parse the webhook payload. Refer to the README for usage instructions.
- 09e1e7b: Include SDK version as header in all requests to our API so we can better debug failures and issues.
- 9e5c278: add support for creating label types (createLabelType)
- acb9a2b: Added 'upsertCompany' support to SDK
- a1499d2: Update graphql types
- 925fa35: Export all webhook typescript types for use when building things"
- bb3cb38: Fix generated webhook types to include payloads for slack webhooks
- 3d158d5: Regenerate types for slack webhooks (
thread.slack_message_received
andthread.slack_message_sent
)
- c4e3c9c: You can now omit the thread title when creating a thread and AI will generate it for you (if you have this enabled in your settings)
- 9098a32: Testing automated release process
- f69fc2d: Fixed webhook schema definition
- 5ebe2c5: Test automatic release process
- ee04953: No changes were made - version is used for testing purposes.
- cade7ea: Update Plain webhook schemas
- 31e5f27: Updated webhook schema
- 23f457c: Update schema for tier membership endpoints
- 9822663: Added updateThreadTenant
- 22e0d28: Added support for setting the company and tenant tier directly via
updateTenantTier
andupdateCompanyTier
respectively. Also expanded return types of tier and membership related mutations.
- c24b8ac: Add support for thread fields, adding and removing them:
upsertThreadField
anddeleteThreadField
- 1b43893: Changed the input type to removingMemberFromTier mutation.
- 21b6db9: Updated types to reflect new way to filter threads by tier identifiers
- 47871dc: Remove unused TimelineEntry from SDK
-
4551691: Added the following queries:
getCustomerCustomerGroupMemberships
getCustomerTenantMemberships
getTenantById
getTenants
searchTenants
getCompanies
searchCompanies
getTierById
getTiers
Added support for the following mutations:
upsertTenant
setCustomerTenants
addCustomerToTenants
removeCustomerFromTenants
updateCustomerCompany
addMembersToTier
removeMembersFromTier
Breaking change:
- You previously received customer group memberships whenever you got a customer back. As there might be many customer groups this is now it's own separate query (
getCustomerCustomerGroupMemberships
). This allows you to fetch and paginate through a customer's customer groups.
- 1c3167e: Add
createNote
method to the SDK
- 9d45fb2: Removes some unneeded packages
- 046ed23: Add a 'parsePlainWebhook' method which validates and types an incoming Plain webhook payload
- a2ab671: Expose ComponentInput and EventComponentInput
- 772d0c6: Add support for creating, updating, deleting and fetcing webhook targets.
- 3d7148a: Export Public fragment types, which flatten connection object edges into arrays
- 1cdb361: Export missing types
- 0d9b3d6: Updates the customer fragment so that it also fetches customer groups
- 69f6239: Adds the ability to get a thread by its external id
- 8ce2a2f: Adds the ability to create customer and thread events via the
createCustomerEvent
andcreateThreadEvent
methods.
- 112e6cf: Rename
userByEmail
togetUserByEmail
and deprecate old method.
- 0901359: Add ability to get a user by email (userByEmail)
- b8ab363: Added
replyToThread
support. This lets you quickly reply to any thread when, for example, building an autoresponder.
-
dfa8d1c: Breaking change
uiComponent.spacer({ spacingSize: 'M' })
is nowuiComponent.spacer({ size: 'M' })
to match naming convention with all other components. -
dfa8d1c: Removed deprecated endpoints in support of the release of threads for Plain. For a full migration guide visit Migrate to threads on our docs site.
The breaking changes are as follows:
The
customer
object has been simplified thanks to the introduction of theThread
object. Specifically the following fields were removed:status
statusChangedAt
assignedToUser
assignedAt
lastIdleAt
The following related methods have been removed from the client:
changeCustomerStatus
Issues have been removed and replaced with Labels.
The following related methods have been removed from the client:
createIssue
resolveIssue
deleteIssue
getIssues
Custom timeline entries have been split into two more specific APIs: threads and events.
The following methods have been removed from the client:
upsertCustomTimelineEntry
Chat support in Plain has been deprecated. As a replacement you may want to consider building a contact form instead.
The following methods have been removed from the client:
sendChat
- 0869269: Add support for deleting customers (
deleteCustomer()
)
- f781425: Improve permission denied error handling so that if you are missing any permissions, the error now tells you which ones they are.
- 2ec7d29: Switch out axios for native fetch so that the SDK can be used in edge functions/runtimes.
- d25f9eb: Update CreateThreadInput to take
description
instead ofpreviewText
- a817cfa: Fix removing of labels from threads and document client methods which were previously marked as experimental.
- 0b1f810: Added more queries and mutations relating to threads (experimental)
- 1a69fa8: Add
uiComponent
builder so you can more easily create ui components for use with the API.
- bb1ea6a: Updated error handling to avoid ignoring bad input errors
- 18ae5a5: Add support for changing thread priority. Expose ThreadStatus and other useful enums and types
- dcf4068: Add initial queries and mutations for threads, label types and labels.
- 4e55386: Allow other package managers besides pnpm
- 19c4c30: Add support for deleting issues via
client.deleteIssue()
- 6cbf990: Add ability to send chat via
client.sendChat()
- 79b99b3: Add ability to change customer status via
client.changeCustomerStatus()
- 34c06ba: Add ability to get issues (
client.getIssues()
) and resolve issues (client.resolveIssue()
)
- 40c0f50: Add ability to delete Customer Card configs.
- 910fe46: Add support for creating and updating Customer Card configurations. Useful if you want to programatically set up Customer Cards.
- d6f94d6: Expose error types:
PlainSDKError
,ForbiddenError
,BadRequestError
,InternalServerError
,MutationError
andUnknownError
- 2974363: Adds getMyWorkspace to fetch the workspace of the authenticated API key
- cc82b7f: Export CustomerPartsFragment type
-
0d1add7: Adds support for querying customer groups:
getCustomerGroupById
- returns a single customer group by IDgetCustomerGroups
- returns a pagniated list of customer groups
Adds support for querying customers:
getCustomers
- returns a paginated list of customers that can be filtered and sorted
- f3aeccf: Expose
AttachmentType
for use when creating attachment upload urls
- f55d303: Add support for creating attachment upload urls for use with custom timeline entries, emails and chat
-
39bc31b: Changed return type of upserting customer to include the upsert 'result' (e.g. if it the customer was created, updated or not modified). This means you will have to slight adjust your code to account for this.
For example in the below code this would be the change you now have to make:
const client = new PlainClient({ apiKey: '' }); const res = await client.upsertCustomer({ identifier: { email: '[email protected]', }, onCreate: { fullName: 'Foo Bar', email: { email: '[email protected]', isVerified: true, }, }, onUpdate: {}, }); if (res.error) { console.error(res.error); throw new Error(res.error.message); } - console.log(`Created customer with id=${res.data.id}`); + console.log(`Created customer with id=${res.data.customer.id}`);
- 39bc31b: Added a query to get the customer by their email (
getCustomerByEmail
) and the ability to send and reply to emails viasendNewEmail
andreplyToEmail
respectively.
- be8a61d: Added a new 'requestId' field to all errors for better debugging and support when something unexpected happens.
- 4cda0b8: Support providing a custom API endpoint for testing internally at Plain against staging and other environments.
- d1404de: Conform including TypeScript declarations for the npm package,
typings
totypes
- ae66dd3: Export useful graphql enums
- ada8307: Export useful graphql types
- d70cbd4: Rename the exported client from
PlainSDKClient
toPlainClient
- 60ce422: Update input types to allow omiting null inputs
- 60ce422: Fix the return type of of upserting a customer (it can not be null)
- fd25dcc: Add the ability to add and remove customers from groups as well as create custom timeline entries.
- 006f20a: First public release 🎉