René's URL Explorer Experiment


Title: Create an example job using the Anthropic API and SDK · Issue #21 · triggerdotdev/api-reference · GitHub

Open Graph Title: Create an example job using the Anthropic API and SDK · Issue #21 · triggerdotdev/api-reference

X Title: Create an example job using the Anthropic API and SDK · Issue #21 · triggerdotdev/api-reference

Description: Overview: While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet. Detai...

Open Graph Description: Overview: While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we ...

X Description: Overview: While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we ...

Opengraph URL: https://github.com/triggerdotdev/api-reference/issues/21

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Create an example job using the Anthropic API and SDK","articleBody":"## Overview:\r\n\r\nWhile we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we don’t have an integration for yet.\r\n\r\n## Details:\r\n\r\nIn this example, you will build a simple job using the Anthropic API and SDK. This will replace the GitHub example we currently have in the app:\r\n\r\n![2023-10-23 3](https://github.com/triggerdotdev/api-reference/assets/8297864/57a785ed-b3fd-49bd-9c86-1cde4f8690e1)\r\n\r\n## Requirements:\r\n\r\n- Use the structure of our [GitHub API reference file](https://github.com/triggerdotdev/api-reference/blob/main/src/github.ts).\r\n- The job must connect to the [Anthropic API](https://docs.anthropic.com/claude/reference/getting-started-with-the-api), using the [SDK](https://github.com/anthropics/anthropic-sdk-typescript), and return an example payload from the API.\r\n\r\n## Guidelines:\r\n\r\n- The job should use an `eventTrigger`.\r\n- The job should use `zod` to define the payloads.\r\n- Use native fetch where no official SDK or incompatible auth\r\n- Avoid external packages apart from offical SDKs\r\n- Only use `io.backgroundFetch()` where absolutely necessary\r\n- Prefer REST over GraphQL - avoid raw queries\r\n- Use a minimal `io.runTask()` callback - initialise clients and auth in global scope if possible\r\n- Leave clear comments with links to relevant developer docs, API key pages etc. [The Discord example](https://github.com/triggerdotdev/api-reference/blob/main/src/discord.ts) is the level of commenting we are looking for. \r\n\r\n​\r\n## Required Structure:\r\n\r\n1. Follow [this guide](https://github.com/triggerdotdev/api-reference#setup-how-to-use-this-repo) to get the project setup.​\r\n2. Create a new file in the src folder, named to match the API (e.g. GitHub would be called github.ts).​\r\n3. The Trigger.dev client must be defined at the top of the job, with the 'api-reference' id:\r\n\r\n```ts\r\nconst client = new TriggerClient({ id: \"api-reference\" });\r\n```\r\n​\r\n4. You must add the Express specific lines to the bottom of the Job file:\r\n​\r\n```ts\r\n// These lines can be removed if you don't want to use express\r\nimport { createExpressServer } from \"@trigger.dev/express\";\r\ncreateExpressServer(client);\r\n```\r\n​\r\n5. You must add the new script to the package.json file, in this format:\r\n​\r\n```ts\r\n\"scripts\": {\r\n  //..other scripts\r\n  \"\u003capi-name>\": \"nodemon --watch src/\u003capi name>.ts -r tsconfig-paths/register -r dotenv/config src/\u003capi name>.ts\"\r\n}\r\n```\r\n\r\n> [!IMPORTANT]\r\nYou must test this Job works before submitting your PR, including a screenshot of a successful run. This may involve you having to setup accounts with services.\r\n>","author":{"url":"https://github.com/D-K-P","@type":"Person","name":"D-K-P"},"datePublished":"2023-10-23T12:49:51Z","url":"https://github.com/triggerdotdev/api-reference/issues/21"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4da75f19-0573-1117-0207-22ee1768b8a7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBE48:68EC4:191A2A:236824:6AFB6AC7
html-safe-nonceb2161923834982decbc1ad5c5dff99008a2d2943454be26a678708e1907747b9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTQ4OjY4RUM0OjE5MUEyQToyMzY4MjQ6NkFGQjZBQzciLCJ2aXNpdG9yX2lkIjoiMzE0MjgyMTE2MjYwNzg0ODM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac4d398231dc4c5aaef36c62351435dddd3866462d47eaadb87a5853e551419a4b
hovercard-subject-tagissue:1957092038
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/triggerdotdev/api-reference/21/issue_layout
twitter:imagehttps://opengraph.githubassets.com/eb1b5a3f3ccffd72566c5618b489ab7472ac71123a557a35b850a8e56ca521ad/triggerdotdev/api-reference/issues/21
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eb1b5a3f3ccffd72566c5618b489ab7472ac71123a557a35b850a8e56ca521ad/triggerdotdev/api-reference/issues/21
og:image:altOverview: While we build our official integrations, we want to create examples of how to create jobs which use other APIs with Trigger.dev. This reference will be used in the app on any service we ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameD-K-P
hostnamegithub.com
expected-hostnamegithub.com
Nonecca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700
turbo-cache-controlno-preview
go-importgithub.com/triggerdotdev/api-reference git https://github.com/triggerdotdev/api-reference.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id706112555
octolytics-dimension-repository_nwotriggerdotdev/api-reference
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id706112555
octolytics-dimension-repository_network_root_nwotriggerdotdev/api-reference
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release88808b1fae5ab8a526a73e7ce5542a10eb9d6971
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/triggerdotdev/api-reference/issues/21#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Fapi-reference%2Fissues%2F21
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Fapi-reference%2Fissues%2F21
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=triggerdotdev%2Fapi-reference
Reloadhttps://github.com/triggerdotdev/api-reference/issues/21
Reloadhttps://github.com/triggerdotdev/api-reference/issues/21
Reloadhttps://github.com/triggerdotdev/api-reference/issues/21
triggerdotdevhttps://github.com/triggerdotdev
api-referencehttps://github.com/triggerdotdev/api-reference
Codehttps://github.com/triggerdotdev/api-reference
Issueshttps://github.com/triggerdotdev/api-reference/issues
Pull requests1 (1)https://github.com/triggerdotdev/api-reference/pulls
Actionshttps://github.com/triggerdotdev/api-reference/actions
Projectshttps://github.com/triggerdotdev/api-reference/projects
Security and qualityhttps://github.com/triggerdotdev/api-reference/security
Insightshttps://github.com/triggerdotdev/api-reference/pulse
https://github.com/triggerdotdev/api-reference
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/api-reference/issues/21
New issuehttps://github.com/login?return_to=https://github.com/triggerdotdev/api-reference/issues/21
#143https://github.com/triggerdotdev/api-reference/pull/143
Create an example job using the Anthropic API and SDKhttps://github.com/triggerdotdev/api-reference/issues/21#top
#143https://github.com/triggerdotdev/api-reference/pull/143
https://github.com/D-K-P
D-K-Phttps://github.com/D-K-P
on Oct 23, 2023https://github.com/triggerdotdev/api-reference/issues/21#issue-1957092038
https://private-user-images.githubusercontent.com/8297864/277341101-57a785ed-b3fd-49bd-9c86-1cde4f8690e1.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTQ4NjIwNjcsIm5iZiI6MTc5NDg2MTc2NywicGF0aCI6Ii84Mjk3ODY0LzI3NzM0MTEwMS01N2E3ODVlZC1iM2ZkLTQ5YmQtOWM4Ni0xY2RlNGY4NjkwZTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTExNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMTZUMjA0MjQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmRhODU2YmYxNGU1OTk2YzY1NWE3OTMxNTFmZjU2NWUzMWZhMmI3NTM1Mzk4NWNmZmQ2YzBjOTQyZjI1Njg3YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.Yl7wUPOt2ffnyKzdycCbIwhkiyST3tKc3c0_bJlPJY0
GitHub API reference filehttps://github.com/triggerdotdev/api-reference/blob/main/src/github.ts
Anthropic APIhttps://docs.anthropic.com/claude/reference/getting-started-with-the-api
SDKhttps://github.com/anthropics/anthropic-sdk-typescript
The Discord examplehttps://github.com/triggerdotdev/api-reference/blob/main/src/discord.ts
this guidehttps://github.com/triggerdotdev/api-reference#setup-how-to-use-this-repo
D-K-Phttps://github.com/D-K-P
🎃hacktoberfesthttps://github.com/triggerdotdev/api-reference/issues?q=state%3Aopen%20label%3A%22%F0%9F%8E%83hacktoberfest%22
💎💎 250 pointshttps://github.com/triggerdotdev/api-reference/issues?q=state%3Aopen%20label%3A%22%F0%9F%92%8E%F0%9F%92%8E%20250%20points%22
on Oct 23, 2023https://github.com/triggerdotdev/api-reference/issues/21#event-10740329025
D-K-Phttps://github.com/D-K-P
🎃hacktoberfesthttps://github.com/triggerdotdev/api-reference/issues?q=state%3Aopen%20label%3A%22%F0%9F%8E%83hacktoberfest%22
💎💎 250 pointshttps://github.com/triggerdotdev/api-reference/issues?q=state%3Aopen%20label%3A%22%F0%9F%92%8E%F0%9F%92%8E%20250%20points%22
on Nov 1, 2023https://github.com/triggerdotdev/api-reference/issues/21#event-10830303134
D-K-Phttps://github.com/D-K-P
completedhttps://github.com/triggerdotdev/api-reference/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#143https://github.com/triggerdotdev/api-reference/pull/143
on Feb 15, 2024https://github.com/triggerdotdev/api-reference/issues/21#event-11817356746
Sign up for freehttps://github.com/signup?return_to=https://github.com/triggerdotdev/api-reference/issues/21
Sign in to commenthttps://github.com/login?return_to=https://github.com/triggerdotdev/api-reference/issues/21
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.