{"id":15442497,"url":"https://github.com/promptable/promptable-web-sdk","last_synced_at":"2025-07-01T04:07:08.238Z","repository":{"id":65063148,"uuid":"581621387","full_name":"promptable/Promptable-web-sdk","owner":"promptable","description":"Web SDK for Promptable Website.","archived":false,"fork":false,"pushed_at":"2022-12-28T20:03:13.000Z","size":84,"stargazers_count":36,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-19T20:19:12.009Z","etag":null,"topics":["ai","chaining","compose","gpt-3","llm","model","nlp","prompt","promptable","promptengineering","prompting","prompts"],"latest_commit_sha":null,"homepage":"https://promptable.ai","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/promptable.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}},"created_at":"2022-12-23T18:37:44.000Z","updated_at":"2025-01-21T18:01:11.000Z","dependencies_parsed_at":"2022-12-24T17:52:27.264Z","dependency_job_id":null,"html_url":"https://github.com/promptable/Promptable-web-sdk","commit_stats":null,"previous_names":["promptable/promptable.js"],"tags_count":0,"template":false,"template_full_name":"jasonsturges/typescript-npm-package","purl":"pkg:github/promptable/Promptable-web-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptable%2FPromptable-web-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptable%2FPromptable-web-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptable%2FPromptable-web-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptable%2FPromptable-web-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/promptable","download_url":"https://codeload.github.com/promptable/Promptable-web-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/promptable%2FPromptable-web-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262893641,"owners_count":23380710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ai","chaining","compose","gpt-3","llm","model","nlp","prompt","promptable","promptengineering","prompting","prompts"],"created_at":"2024-10-01T19:28:08.899Z","updated_at":"2025-07-01T04:07:08.205Z","avatar_url":"https://github.com/promptable.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Promptable\n\nA simple, lightweight, and flexible library for building prompt engineering pipelines in Typescript/Javascript.\n\n## Getting Started\n\n```\nnpm install promptable\n```\n\n## Usage\n\n```ts\nimport { PromptableApi, OpenAi } from \"promptable\";\n\nconst promptDeployment = PromptableApi.getActiveDeployment({\n  promptId: \"\u003cyour prompt id\u003e\",\n});\n\n// Inject any variables you're using\nconst prompt = PromptableApi.injectVariables({\n  promptDeployment,\n  variables: {\n    greetings: \"Hi! whats up?\",\n  },\n});\n\n// completion support (streaming coming soon!)\nconst completion = await OpenAi.runCompletion({\n  req,\n  apiKey,\n});\n```\n\n# TypeScript NPM Package\n\nScaffold TypeScript npm packages using this template to bootstrap your next library.\n\nThis project includes:\n\n- [TypeScript](https://www.typescriptlang.org/)\n- [Rollup](https://rollupjs.org/)\n- [Microsoft API Extractor](https://api-extractor.com/)\n- [TypeDoc](https://typedoc.org/)\n\nVersions of this template:\n\n- [Vite TypeScript library npm package](https://github.com/jasonsturges/vite-typescript-npm-package)\n- [Vite JavaScript library npm package](https://github.com/jasonsturges/vite-npm-package)\n- [Rollup JavaScript library npm package](https://github.com/jasonsturges/npm-package-boilerplate)\n- [Rollup TypeScript library npm package](https://github.com/jasonsturges/typescript-npm-package)\n\n## Getting Started\n\nBegin via any of the following:\n\n- Press the \"_Use this template_\" button\n\n- Use [degit](https://github.com/Rich-Harris/degit) to execute:\n\n  ```\n  degit github:jasonsturges/typescript-npm-package\n  ```\n\n- Use [GitHub CLI](https://cli.github.com/) to execute:\n\n  ```\n  gh repo create \u003cname\u003e --template=\"https://github.com/jasonsturges/typescript-npm-package\"\n  ```\n\n- Simply `git clone`, delete the existing .git folder, and then:\n\n  ```\n  git init\n  git add -A\n  git commit -m \"Initial commit\"\n  ```\n\nRemember to use `npm search \u003cterm\u003e` to avoid naming conflicts in the NPM Registery for your new package name.\n\n## Usage\n\nThe following tasks are available for `npm run`:\n\n- `dev`: Run Rollup in watch mode to detect changes to files during development\n- `build`: Run Rollup to build a production release distributable\n- `build:types`: Run Microsoft API Extractor to rollup a types declaration (`d.ts`) file\n- `docs`: Run TypeDoc for TSDoc generated documentation in the \"_docs/_\" folder\n- `clean`: Remove all build artifacts\n\n## Development\n\nWhile test driven development (TDD) would be a good approach to develop your library, also consider creating an app for prototyping and local testing of your library.\n\nTo test within the library, consider using [Storybook](https://storybook.js.org/). This approach runs a `storybook` script to load local source files for development.\n\nOtherwise, follow these steps to test the package from another project:\n\n**From your library project**, issue the `npm link` (or `yarn link`) command:\n\n```\nnpm link\n```\n\nStart Rollup in watch mode:\n\n```\nnpm run dev\n```\n\n**Create a test app project**, by doing the following:\n\nTo use your npm package library locally for development, create a new project in a separate folder:\n\n```\nmkdir test-app \u0026\u0026 cd test-app\nnpm init\n```\n\nTake the defaults from `npm init`; then, add TypeScript:\n\n```\nnpm install typescript --save-dev\n```\n\nIn the package.json of your test app, add the following two things:\n\n- Set the `type` of your package to `module`\n- Add a `start` script to execute your app\n\n```json\n\"type\": \"module\",\n\"scripts\": {\n  \"start\": \"tsc \u0026\u0026 node index.js\",\n},\n```\n\nLink to your library using the `npm link \u003cname\u003e` (or `yarn link \u003cname\u003e`) command - be sure the `\u003cname\u003e` matches your library's package.json name. For example:\n\n```\nnpm link typescript-npm-package\n```\n\nAdd a \"_tsconfig.json_\" file to your test app that includes a `baseUrl` and references the `paths` to your npm linked module. Again, be sure the `paths` name matches your library's package.json name. For example:\n\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"es6\",\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"typescript-npm-package\": [\"node_modules/typescript-npm-package/src\"],\n      \"typescript-npm-package/*\": [\"node_modules/typescript-npm-package/src/*\"]\n    }\n  }\n}\n```\n\nNow, run your app via `npm start`.\n\nAs an example, if your library's \"_index.ts_\" file contained:\n\n```ts\nexport const sayHi = () =\u003e {\n  console.log(\"Hi\");\n};\n```\n\n...your test app would implement an import using your package name, such as:\n\n```ts\nimport { sayHi } from \"typescript-npm-package\";\n\nsayHi();\n```\n\n## Development Cleanup\n\nOnce development completes, `unlink` both your library and test app projects.\n\n**From your test app project**, unlink the library using `npm unlink \u003cname\u003e` (or `yarn unlink \u003cname\u003e`) command:\n\n```\nnpm unlink typescript-npm-package\n```\n\n**From your library project**, issue the `npm unlink` (or `yarn unlink`) command:\n\n```\nnpm unlink\n```\n\n## Release Publishing\n\nUpdate your `package.json` to next version number, and remember to tag a release.\n\nOnce ready to submit your package to the NPM Registry, execute the following tasks via `npm` (or `yarn`):\n\n- `npm run clean` \u0026mdash; Assure a clean build\n- `npm run build` \u0026mdash; Build the package\n- `npm run build:types` \u0026mdash; Build API Extractor d.ts declaration\n\nAssure the proper npm login:\n\n```\nnpm login\n```\n\nSubmit your package to the registry:\n\n```\nnpm publish --access public\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpromptable%2Fpromptable-web-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpromptable%2Fpromptable-web-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpromptable%2Fpromptable-web-sdk/lists"}