{"_id":"@anyprompt/sdk","_rev":"3-3e8dfdbde86b364f9fb3599566f5aa02","name":"@anyprompt/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@anyprompt/sdk","version":"0.1.0","author":{"name":"Stephen Chen"},"license":"MIT","_id":"@anyprompt/sdk@0.1.0","maintainers":[{"name":"syhchen","email":"hello@stephenc.me"}],"dist":{"shasum":"f787c5fe2c766b3134ef52c16cefa6edf85cbddc","tarball":"https://registry.npmjs.org/@anyprompt/sdk/-/sdk-0.1.0.tgz","fileCount":8,"integrity":"sha512-qbHAm/w7HmD9I5X3Vz42jqW3EaSUsvzx3WJhv8C+c38wUSfkSDeP1fyDXsSp9DLKvFex4Dr9JQ6zuONgxviPJw==","signatures":[{"sig":"MEQCIFBUjjjkeDEf3YIbT40zgbUjqd06CiOJtfd3qjvGtwHQAiBinLzYgDZWD+ix+u8zzoiYuyuqkOx74F29PabCXqLBYQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10135},"main":"dist/AnyPromptSDK.js","types":"dist/AnyPromptSDK.d.ts","gitHead":"b8abcb5acc4f02e2c9a2f335be0304657c90536f","scripts":{"build":"tsc"},"_npmUser":{"name":"syhchen","email":"hello@stephenc.me"},"_npmVersion":"10.9.0","description":"A lightweight SDK for interacting with AnyPromptCore, enabling the fetching and usage of prompt templates from an external API.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"@anyprompt/core":"0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5","@types/node":"^20"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1737427654813_0.08972649841546865","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-01-21T02:47:34.689Z","modified":"2026-02-13T17:54:34.648Z","0.1.0":"2025-01-21T02:47:34.975Z"},"author":{"name":"Stephen Chen"},"license":"MIT","description":"A lightweight SDK for interacting with AnyPromptCore, enabling the fetching and usage of prompt templates from an external API.","maintainers":[{"email":"notquitedigital@gmail.com","name":"stephencme"}],"readme":"# @anyprompt/sdk\n\nAn SDK on top of AnyPromptCore for fetching and rendering prompt templates configured via an external API.\n\n## Features\n\n- Fetch prompt template versions from a specified API.\n- Render prompt templates with injected variables.\n- Easy integration with popular AI clients like OpenAI and Anthropic.\n\n## Usage\n\n### Importing the Library\n\n```typescript\nimport { AnyPromptSDK } from \"@anyprompt/sdk\"\n```\n\n### Example with OpenAI API\n\n```typescript\nimport { AnyPromptSDK } from \"@anyprompt/sdk\"\nimport { OpenAI } from \"openai\"\n\n// Initialize AnyPromptSDK\nconst apsdk = new AnyPromptSDK(\"your-api-url\", \"your-api-anon-key\")\n\n// Initialize OpenAI client\nconst client = new OpenAI({ apiKey: \"your-openai-api-key\" })\n\n// Render a prompt template and call OpenAI API\nasync function summarizeEmail(email: string) {\n  const prompt = await apsdk.renderPrompt(\"summarizeEmail@0.1.0\", { email })\n\n  const response = await client.chat.completions.create({\n    messages: [{ role: \"user\", content: prompt }],\n    model: \"gpt-4o\",\n  })\n\n  return response.choices[0].message.content\n}\n\n// Example usage\nconst email =\n  \"Let's find a time to catch up soon! I'm typically busy Monday through Thursday but free most any other day next week.\"\nconst summary = await summarizeEmail(email)\nconsole.log(\"Summary:\", summary) // \"Summary: The sender suggests catching up next week on Friday, Saturday, or Sunday.\"\n```\n","readmeFilename":"README.md"}