{"_id":"@a5omic/veil","name":"@a5omic/veil","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@a5omic/veil","version":"0.1.0","description":"Official JavaScript helpers for the hosted Veil API","type":"module","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"main":"./index.js","types":"./index.d.ts","sideEffects":false,"engines":{"node":">=18"},"publishConfig":{"access":"public"},"keywords":["veil","pii","privacy","redaction","openai","llm","hipaa","coppa"],"homepage":"https://veil-api.com","repository":{"type":"git","url":"git+https://github.com/Atomics-hub/veil-examples.git"},"bugs":{"url":"https://github.com/Atomics-hub/veil-examples/issues"},"license":"MIT","_id":"@a5omic/veil@0.1.0","gitHead":"0a2fa6b150acb1b706083a46795e2c298f0c2efe","_nodeVersion":"24.8.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-gD6a0ztDTwPW1A0KJAxFVcspw/8GUu0/1xFbx0NgGdjG6W1v1I66gczK9j7pmKHIHP+c7nzcRduWr5gycXpgNg==","shasum":"a9fc788f03ca92deeb010bca9fc8c3722cd7a276","tarball":"https://registry.npmjs.org/@a5omic/veil/-/veil-0.1.0.tgz","fileCount":5,"unpackedSize":14443,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC28y0vChX8lDsA4SQsiTfsRS58OpJ5zFuzwdH4p6Y1qgIgBO/NZ4hv4wJ1+XwlWCabHgfwdTHz7q2ijJ/epXL3g0Q="}]},"_npmUser":{"name":"a5omic","email":"therekishianime@gmail.com"},"directories":{},"maintainers":[{"name":"a5omic","email":"therekishianime@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/veil_0.1.0_1775867615092_0.5308320432535241"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-11T00:33:34.978Z","0.1.0":"2026-04-11T00:33:35.229Z","modified":"2026-04-11T00:33:35.463Z"},"maintainers":[{"name":"a5omic","email":"therekishianime@gmail.com"}],"description":"Official JavaScript helpers for the hosted Veil API","homepage":"https://veil-api.com","keywords":["veil","pii","privacy","redaction","openai","llm","hipaa","coppa"],"repository":{"type":"git","url":"git+https://github.com/Atomics-hub/veil-examples.git"},"bugs":{"url":"https://github.com/Atomics-hub/veil-examples/issues"},"license":"MIT","readme":"# Veil Examples\n\nExamples and the official JavaScript helpers for integrating with the hosted [Veil API](https://veil-api.com).\n\nVeil lets you send prompts through a privacy layer before they reach OpenAI or another provider. Sensitive data is redacted on the way out and restored on the response back.\n\nThis repo is intentionally public and intentionally limited:\n- It shows how to use Veil\n- It does not include Veil's backend or internal implementation\n\n## Why Veil\n\n- Keep names, emails, phone numbers, SSNs, and other sensitive values out of upstream LLM requests\n- Keep your existing provider and model choices\n- Use an OpenAI-compatible API surface\n- Start with a hosted product instead of building your own redaction layer\n\n## Start Free\n\n- Get a free API key: [veil-api.com/#pricing](https://veil-api.com/#pricing)\n- Read the docs: [veil-api.com/docs](https://veil-api.com/docs)\n- Test the live demo: [veil-api.com/#try](https://veil-api.com/#try)\n\n## Install the JS Package\n\n```bash\nnpm install @a5omic/veil openai\n```\n\n## Get Started\n\n1. Sign up at [veil-api.com](https://veil-api.com)\n2. Get a Veil API key\n3. Keep your own upstream provider key\n4. Point your client at `https://veil-api.com/v1`\n\n## Required Headers\n\n- `Authorization: Bearer <VEIL_API_KEY>`\n- `x-upstream-key: <YOUR_PROVIDER_KEY>`\n- Optional: `x-upstream-provider: openai|groq|together|mistral|...`\n\n## Environment Variables\n\n```bash\nexport VEIL_API_KEY=your_veil_key\nexport OPENAI_API_KEY=your_provider_key\n```\n\n## Quick Example: Python\n\n```python\nfrom openai import OpenAI\nimport os\n\nclient = OpenAI(\n    api_key=os.environ[\"OPENAI_API_KEY\"],\n    base_url=\"https://veil-api.com/v1\",\n    default_headers={\n        \"Authorization\": f\"Bearer {os.environ['VEIL_API_KEY']}\",\n        \"x-upstream-key\": os.environ[\"OPENAI_API_KEY\"],\n    },\n)\n\nresponse = client.chat.completions.create(\n    model=\"gpt-4o-mini\",\n    messages=[\n        {\n            \"role\": \"user\",\n            \"content\": \"Summarize: Customer Jane Doe (jane@company.com) called from 555-123-4567.\",\n        }\n    ],\n)\n\nprint(response.choices[0].message.content)\n```\n\n## Quick Example: JavaScript\n\n```javascript\nimport OpenAI from 'openai';\nimport { createVeilOpenAIConfig } from '@a5omic/veil';\n\nconst client = new OpenAI(createVeilOpenAIConfig({\n  veilApiKey: process.env.VEIL_API_KEY,\n  upstreamApiKey: process.env.OPENAI_API_KEY,\n}));\n\nconst response = await client.chat.completions.create({\n  model: 'gpt-4o-mini',\n  messages: [\n    {\n      role: 'user',\n      content: 'Summarize: Customer Jane Doe (jane@company.com) called from 555-123-4567.',\n    },\n  ],\n});\n\nconsole.log(response.choices[0].message.content);\n```\n\n## Redact-Only Example: JavaScript\n\n```javascript\nimport { VeilClient } from '@a5omic/veil';\n\nconst veil = new VeilClient({\n  apiKey: process.env.VEIL_API_KEY,\n});\n\nconst result = await veil.redact({\n  text: 'admit date: 03/15/2024, patient age: 92, MRN: AB123456',\n  compliance: 'hipaa',\n});\n\nconsole.log(result);\n```\n\n## Quick Example: cURL\n\n```bash\ncurl -X POST https://veil-api.com/v1/chat/completions \\\n  -H \"Authorization: Bearer $VEIL_API_KEY\" \\\n  -H \"x-upstream-key: $OPENAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"gpt-4o-mini\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Summarize: Customer Jane Doe (jane@company.com) called from 555-123-4567.\"\n      }\n    ]\n  }'\n```\n\n## Example Files\n\n- [examples/python/basic.py](examples/python/basic.py)\n- [examples/python/streaming.py](examples/python/streaming.py)\n- [examples/python/redact_only.py](examples/python/redact_only.py)\n- [examples/python/multi_provider.py](examples/python/multi_provider.py)\n- [examples/javascript/basic.mjs](examples/javascript/basic.mjs)\n- [examples/javascript/redact_only.mjs](examples/javascript/redact_only.mjs)\n- [examples/javascript/streaming.mjs](examples/javascript/streaming.mjs)\n- [examples/curl/basic.sh](examples/curl/basic.sh)\n- [examples/curl/redact.sh](examples/curl/redact.sh)\n- [examples/curl/providers.sh](examples/curl/providers.sh)\n\n## Compliance Modes\n\n- `x-veil-compliance: hipaa` and `x-veil-compliance: coppa` are available on Growth+ plans.\n- Compliance mode adds stricter redaction plus audit logging for regulated text workflows.\n- Compliance mode is intentionally text-only today and does not support streaming or multimodal image/audio requests.\n\n## Docs\n\n- Product site: [veil-api.com](https://veil-api.com)\n- API docs: [veil-api.com/docs](https://veil-api.com/docs)\n- Providers list: [veil-api.com/v1/providers](https://veil-api.com/v1/providers)\n\n## Hosted Product\n\nVeil is a hosted API product. This repo is examples-only and does not include the private backend, infrastructure, detection pipeline, or internal operations code.\n\nIf you want to use Veil in production, start here:\n- [Get a free API key](https://veil-api.com/#pricing)\n- [Read the docs](https://veil-api.com/docs)\n- [See all examples in this repo](https://github.com/Atomics-hub/veil-examples/tree/main/examples)\n","readmeFilename":"README.md","_rev":"1-cb417312798f0c1a094d92dfa73cf4b9"}