{"id":41235909,"url":"https://github.com/inkeep/helpscout-ticket-creation-vercel","last_synced_at":"2026-01-23T01:03:30.584Z","repository":{"id":224912511,"uuid":"764466157","full_name":"inkeep/helpscout-ticket-creation-vercel","owner":"inkeep","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-10T05:27:50.000Z","size":274,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-03T08:28:07.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://helpscout-ticket-creation-vercel.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inkeep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-28T05:56:21.000Z","updated_at":"2024-04-22T23:23:02.000Z","dependencies_parsed_at":"2024-04-23T01:49:06.656Z","dependency_job_id":null,"html_url":"https://github.com/inkeep/helpscout-ticket-creation-vercel","commit_stats":null,"previous_names":["inkeep/helpscout-ticket-creation-vercel"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/inkeep/helpscout-ticket-creation-vercel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Fhelpscout-ticket-creation-vercel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Fhelpscout-ticket-creation-vercel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Fhelpscout-ticket-creation-vercel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Fhelpscout-ticket-creation-vercel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inkeep","download_url":"https://codeload.github.com/inkeep/helpscout-ticket-creation-vercel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inkeep%2Fhelpscout-ticket-creation-vercel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28676490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"ssl_error","status_checked_at":"2026-01-23T01:00:19.529Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-23T01:03:29.989Z","updated_at":"2026-01-23T01:03:30.560Z","avatar_url":"https://github.com/inkeep.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HelpScout Create Ticket Example\n\n## Getting Started\n\n### From Scratch\nClone this repository:\n\n```bash\ngit clone https://github.com/inkeep/helpscout-ticket-creation-vercel\n```\n\nSetup dependencies:\n\n```bash\npnpm install\n```\n\nCopy the example env file to make a `.env.development.local` for local development.\n\n```bash\ncp .env.example .env.development.local\n```\n\n### Add to an existing project\n\nIf you'd like to add an API route to an existing Next.js project:\n1. Copy the files under `api/create-support-ticket` into your own API route.\n2. Install deps via `pnpm add @vercel/edge-config zod`\n3. Follow the rest of these instructions to get the .env variables you need\n\n## Create HelpScout application\n\n1. Login to HelpScout\n\n2. Open your profile picture then select **Your Profile**.\n\n3. Click on the **My Apps** tab.\n\n4. Click on **Create My App**\n\n6. Provide an **App Name**, like \"Inkeep Create Ticket Flow\" \n\n7. Provide any value for **Redirection URL**, like \"https://{mydoamin}.com\", it's not used.\n\n8. Copy the **App ID** and **App Secret** fields into your env variables\n\n```\nHELPSCOUT_APP_ID=\"\u003cHELPSCOUT_APP_ID\u003e\"\nHELPSCOUT_APP_SECRET=\"\u003cHELPSCOUT_APP_SECRET\u003e\"\n```\n\n## Get a mailbox ID\n\n1. Open **Inbox** tab on HelpScout\n\n2. On left bottom corner open click on the **Gear Icon** and select **Edit Inbox**\n\n3. Copy the ID from the page URL:\n\n```bash\nhttps://secure.helpscout.net/settings/inbox/\u003cHELPSCOUT_MAILBOX_ID\u003e/\n```\n\nAdd it as an env variable:\n\n```\nHELPSCOUT_MAILBOX_ID=\"\u003cHELPSCOUT_MAILBOX_ID\u003e\"\n```\n\n## Help Scout Access Tokens\nHelpScout [access tokens](https://developer.helpscout.com/mailbox-api/overview/authentication/#client-credentials-flow) received via client-credentials (service-to-service authentication) expire after two days. To avoid fetching a new access token on every request, we'll use Vercel's Edge Config to cache the latest access token, which is optimized for scenarios with high read and low write operations.\n\n### Create Edge Config Store\nCreate an Edge Config Store instance for your project. See [here](https://vercel.com/docs/storage/edge-config/get-started#quickstart). \n\nOnce created, copy the `ID` of the Edge Config Store and add it as an env variable:\n\n```\nEDGE_CONFIG_ID=\"\u003cEDGE_CONFIG_ID\u003e\"\n```\n\nCreating an Edge Config Store will also automatically create an `EDGE_CONFIG` env variable in your Vercel project. This is used for reading from the Store using the `@vercel/edge-config` SDK.\n\nFor local development, you can visit your project's **Settings** \u003e **Environment Variables** and copy it.\n\nSet it as an env variable:\n\n```\nEDGE_CONFIG=\"\u003cEDGE_CONFIG\u003e\"\n```\n\n### Vercel API Access Token\n\nNext, create a Vercel API access token. See [here](https://vercel.com/docs/rest-api#creating-an-access-token). This is used to write to the Edge Config. Set the scope to the Vercel team you'd like it to apply to.\n\nAdd it as env variable:\n\n```\nVER_API_ACCESS_TOKEN=\"\u003cVER_API_ACCESS_TOKEN\u003e\"\n```\n\nLastly, set the Vercel Team ID for where your project is located. You can find this under **Settings** under your Team in the [Vercel dashboard](https://vercel.com)\n\n```\nVER_TEAM_ID=\"\u003cVER_TEAM_ID\u003e\"\n```\n\n## Inkeep Preview URL (optional)\nIf you'd like to attach a link to the Inkeep Dashboard view of the AI-chat for reference, then set the following:\n```\nINKEEP_CHAT_PREVIEW_ROOT=https://portal.inkeep.com/\u003cORG_ALIAS\u003e/projects/\u003cPROJECT_ID\u003e/chat/sandbox\n```\nThis will be added as an internal-facing note to the supprot conversation.\n\n## Run locally\n```\npnpm dev\n```\n\n## API Routes\n`/api/create-support-ticket` - Create a new conversation/ticket in your inbox.\n\nSee the [HelpScout Create Conversation API](https://developer.helpscout.com/mailbox-api/endpoints/conversations/create/) for full customization.\n\n\n### Example Request\n\nNote that the request is generated by your client side, please validate that the types and request body align. \n\nThere's an example Zod validation and types in `api/create-support-ticket/requestSchemaValidation.ts`. Validation should be optimistic.\n\n```JSON\n{\n  \"formDetails\": {\n    \"firstName\": \"John\",\n    \"email\": \"j@domain.com\",\n    \"additionalDetails\": \"Would like to change my password, please.\"\n  },\n  \"chatSession\": {\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"How do I change my password?\"\n      },\n      {\n        \"role\": \"assistant\",\n        \"content\": \"Sorry, I wasn't able to find information about that. Please reach out to support.\"\n      }\n    ],\n    \"chatSessionId\": \"12345\"\n  },\n  \"client\": {\n    \"currentUrl\": \"https://example.com/help\"\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkeep%2Fhelpscout-ticket-creation-vercel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finkeep%2Fhelpscout-ticket-creation-vercel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finkeep%2Fhelpscout-ticket-creation-vercel/lists"}