@secured-ai/core
v0.1.1
Published
Zero-dependency PII detection, obfuscation, and de-obfuscation engine
Readme
@secured-ai/core
Browser-first privacy tooling for detecting sensitive data, obfuscating it before it leaves the client, and restoring protected text with the original values when needed.
Install
npm install @secured-ai/coreWhat it provides
PrivacyClientfor local PII detection, obfuscation, restoration, text review, sessions, and vault-backed restoration.- Built-in detection engines for common sensitive data such as names, emails, phone numbers, addresses, account identifiers, government IDs, URLs, and custom patterns.
- Browser file privacy helpers for supported documents and data files.
- TypeScript types for scan results, detected entities, sessions, vault entries, and client configuration.
Basic usage
import { PrivacyClient } from "@secured-ai/core";
const client = new PrivacyClient();
await client.initialize();
const result = await client.obfuscate("Email Jane at [email protected]");
console.log(result.processed);
console.log(result.sessionId);
const restored = await client.restore(result.processed, result.sessionId);
console.log(restored.restored);Vite setup
If you use Vite, exclude the Secured packages from dependency optimization so the browser can load the worker file from the package dist directory during local development:
import { defineConfig } from "vite";
export default defineConfig({
optimizeDeps: {
exclude: ["@secured-ai/core", "@secured-ai/react"],
},
build: {
target: "es2020",
},
});Publishing contents
The npm package is built from dist only. Source files, tests, coverage output, and source maps are not included in the published package.
Docs
See the developer documentation at https://dev-docs.securedai.com/docs/core.
