{"_id":"@code-signal/signal","_rev":"3-b0d40ce0e6b701a8b9428a205cd828d3","name":"@code-signal/signal","dist-tags":{"latest":"1.3.0"},"versions":{"1.2.0":{"name":"@code-signal/signal","version":"1.2.0","keywords":["feature-flags","feature-toggles","sdk"],"author":{"name":"Alien6"},"license":"MIT","_id":"@code-signal/signal@1.2.0","maintainers":[{"name":"coopyrightdmin","email":"admin@coopyrightcode.com"}],"dist":{"shasum":"430f1119f397aee4aed38a59ca1f9c17aa37d044","tarball":"https://registry.npmjs.org/@code-signal/signal/-/signal-1.2.0.tgz","fileCount":105,"integrity":"sha512-jA3nVGiFs7zv0nJs1lKoKZl4wAk6UXZX5B0Mfq50DRip8fyzSefksKcx/vCltqdYWK1obivXqfCqc+lHoLa8mA==","signatures":[{"sig":"MEUCIBcop7Q70FnCWH3iZq3zkcgofzY8sM/miNwyFTCk65tPAiEA64FLQJn8kFcxQZ2LshDmvwvCYFfh2v3C8OkSNHFk0j8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":442993},"main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","module":"./dist/esm/index.js","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"622622a0caa64d985bb980510f3b07f376c5d2f1","scripts":{"dev":"tsc --watch","lint":"eslint src/","test":"vitest","build":"npm run clean && npm run build:cjs && npm run build:esm","clean":"rm -rf dist","test:ui":"vitest --ui","test:run":"vitest run","build:cjs":"tsc","build:esm":"tsc --project tsconfig.esm.json","test:unit":"vitest run --coverage --exclude 'tests/client/**' --exclude 'tests/integration/**'","test:coverage":"vitest run --coverage","test:openfeature":"vitest run tests/openfeature"},"_npmUser":{"name":"coopyrightdmin","email":"admin@coopyrightcode.com"},"_npmVersion":"10.9.7","description":"Feature flags SDK for Alien6 projects - Signal your features","directories":{},"_nodeVersion":"22.22.2","dependencies":{"axios":"^1.6.0"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.2.3","vitest":"^4.0.16","happy-dom":"^20.0.11","@vitest/ui":"^4.0.16","typescript":"^5.3.0","@types/node":"^20.0.0","@types/react":"^19.2.7","axios-mock-adapter":"^2.1.0","@vitest/coverage-v8":"^4.0.18","@openfeature/web-sdk":"^1.7.3","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.1","@openfeature/server-sdk":"^1.20.2","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"react":">=18.0.0","@openfeature/web-sdk":"^1.7.3","@openfeature/server-sdk":"^1.20.2"},"peerDependenciesMeta":{"react":{"optional":true},"@openfeature/web-sdk":{"optional":true},"@openfeature/server-sdk":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/signal_1.2.0_1775583259407_0.6143120617133613","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@code-signal/signal","version":"1.2.1","keywords":["feature-flags","feature-toggles","sdk"],"author":{"name":"Alien6"},"license":"MIT","_id":"@code-signal/signal@1.2.1","maintainers":[{"name":"coopyrightdmin","email":"admin@coopyrightcode.com"}],"dist":{"shasum":"47e8e341d293a07a62820c09e76fb954f4fac092","tarball":"https://registry.npmjs.org/@code-signal/signal/-/signal-1.2.1.tgz","fileCount":106,"integrity":"sha512-bLuWD09AMabDa2139P6/w5LXySpUHjqrdVPsNa5cAs1lxSJUKif5lxgcAygNLKpgdsD/IItM6rzVhIQPd6irjQ==","signatures":[{"sig":"MEYCIQC4o83RWDlIKcZGVY7hT+eHAgImUwlCGIqUu5qEh1BblwIhAJWlsuiQduxL2sFMeiIEqquo9Srga7mD6szLaVF552XK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":446746},"main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","module":"./dist/esm/index.js","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"gitHead":"fe38dad39415df018a17e92623079016e98b1621","scripts":{"dev":"tsc --watch","lint":"eslint src/","test":"vitest","build":"npm run clean && npm run build:cjs && npm run build:esm","clean":"rm -rf dist","test:ui":"vitest --ui","test:run":"vitest run","build:cjs":"tsc","build:esm":"tsc --project tsconfig.esm.json","test:unit":"vitest run --coverage --exclude 'tests/client/**' --exclude 'tests/integration/**'","test:coverage":"vitest run --coverage","test:openfeature":"vitest run tests/openfeature"},"_npmUser":{"name":"coopyrightdmin","email":"admin@coopyrightcode.com"},"_npmVersion":"10.9.7","description":"Feature flag management SDK for modern web applications — server-side evaluation, real-time sync, React bindings, and OpenFeature support.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"axios":"^1.6.0"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.2.3","vitest":"^4.0.16","happy-dom":"^20.0.11","@vitest/ui":"^4.0.16","typescript":"^5.3.0","@types/node":"^20.0.0","@types/react":"^19.2.7","axios-mock-adapter":"^2.1.0","@vitest/coverage-v8":"^4.0.18","@openfeature/web-sdk":"^1.7.3","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.1","@openfeature/server-sdk":"^1.20.2","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"react":">=18.0.0","@openfeature/web-sdk":"^1.7.3","@openfeature/server-sdk":"^1.20.2"},"peerDependenciesMeta":{"react":{"optional":true},"@openfeature/web-sdk":{"optional":true},"@openfeature/server-sdk":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/signal_1.2.1_1775596056259_0.9554293029583436","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@code-signal/signal","version":"1.3.0","description":"Feature flag management SDK for modern web applications — server-side evaluation, real-time sync, React bindings, and OpenFeature support.","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/cjs/index.d.ts","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"scripts":{"build":"npm run clean && npm run build:cjs && npm run build:esm","build:cjs":"tsc","build:esm":"tsc --project tsconfig.esm.json","dev":"tsc --watch","clean":"rm -rf dist","test":"vitest","test:ui":"vitest --ui","test:run":"vitest run","test:coverage":"vitest run --coverage","test:unit":"vitest run --coverage --exclude 'tests/client/**' --exclude 'tests/integration/**'","lint":"eslint src/","test:openfeature":"vitest run tests/openfeature"},"keywords":["feature-flags","feature-toggles","sdk"],"author":{"name":"Alien6"},"license":"MIT","dependencies":{"axios":"^1.6.0"},"devDependencies":{"@openfeature/core":"^1.9.2","@openfeature/server-sdk":"^1.20.2","@openfeature/web-sdk":"^1.7.3","@testing-library/dom":"^10.4.1","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.1","@types/node":"^20.0.0","@types/react":"^19.2.7","@vitest/coverage-v8":"^4.0.18","@vitest/ui":"^4.0.16","axios-mock-adapter":"^2.1.0","happy-dom":"^20.0.11","react":"^19.2.3","typescript":"^5.3.0","vitest":"^4.0.16"},"peerDependencies":{"@openfeature/server-sdk":"^1.20.2","@openfeature/web-sdk":"^1.7.3","react":">=18.0.0"},"peerDependenciesMeta":{"react":{"optional":true},"@openfeature/server-sdk":{"optional":true},"@openfeature/web-sdk":{"optional":true}},"_id":"@code-signal/signal@1.3.0","gitHead":"587f914ca10732afddc36ec8c86e0190230db982","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-KDQFLZsGLcl/g1A/A3O4i2p6KP4AY8DsS2rmzi7PX4NXiWb3oqQpEyVnNIIXLgQKBI0667g/SJ4N03iYQx/fmw==","shasum":"587d82844345ae6c265184d8ebca93cac41b2226","tarball":"https://registry.npmjs.org/@code-signal/signal/-/signal-1.3.0.tgz","fileCount":126,"unpackedSize":483283,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEsSY4q8zHrfUQcMf5xYIkzm4Y6b5grfXGuehkgWSfGGAiEA2olrQ2fnFXzBqOHfJ5BSOe3tz4l23qsWVOJe4PKiO78="}]},"_npmUser":{"name":"coopyrightdmin","email":"admin@coopyrightcode.com"},"directories":{},"maintainers":[{"name":"coopyrightdmin","email":"admin@coopyrightcode.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/signal_1.3.0_1778662664675_0.6575704760598158"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-07T17:34:19.311Z","modified":"2026-05-13T08:57:44.939Z","1.2.0":"2026-04-07T17:34:19.553Z","1.2.1":"2026-04-07T21:07:36.426Z","1.3.0":"2026-05-13T08:57:44.831Z"},"author":{"name":"Alien6"},"license":"MIT","keywords":["feature-flags","feature-toggles","sdk"],"description":"Feature flag management SDK for modern web applications — server-side evaluation, real-time sync, React bindings, and OpenFeature support.","maintainers":[{"name":"coopyrightdmin","email":"admin@coopyrightcode.com"}],"readme":"# @code-signal/signal\n\nFeature flag management SDK for modern web applications.\n\nShip faster, reduce risk, and control every release — without redeployment.\n\n## Features\n\n- **Server-side evaluation** — local flag evaluation for zero-latency (Node.js / SSR)\n- **Client-side sync** — lightweight browser client with real-time updates via WebSocket\n- **React bindings** — hooks and context provider out of the box\n- **OpenFeature support** — drop-in providers for the OpenFeature standard\n- **A/B testing** — built-in variant management and conversion tracking\n- **Type-safe flag keys** — define flags as typed constants, no magic strings\n\n## Installation\n\n```bash\nnpm install @code-signal/signal\n```\n\n## Quick start\n\n### Server-side (Node.js / SSR)\n\n```ts\nimport { initializeServer, getServerInstance } from '@code-signal/signal';\n\nawait initializeServer({\n  apiKey: process.env.SIGNAL_API_KEY,\n  projectId: process.env.SIGNAL_PROJECT_ID,\n  apiUrl: process.env.SIGNAL_API_URL,\n});\n\nconst signal = getServerInstance();\nconst enabled = await signal.isEnabled('my-feature', { userId: 'user-123' });\n```\n\n### Client-side (browser)\n\n```ts\nimport { initializeClient, getClientInstance } from '@code-signal/signal';\n\nawait initializeClient({\n  apiKey: process.env.NEXT_PUBLIC_SIGNAL_API_KEY,\n  projectId: process.env.NEXT_PUBLIC_SIGNAL_PROJECT_ID,\n  apiUrl: process.env.NEXT_PUBLIC_SIGNAL_API_URL,\n  websocket: { enabled: true },\n});\n\nconst signal = getClientInstance();\nconst enabled = await signal.isEnabled('my-feature');\n```\n\n### React\n\n```tsx\nimport { FeatureFlagsProvider, useFeatureFlag } from '@code-signal/signal';\n\nfunction App() {\n  return (\n    <FeatureFlagsProvider config={{ apiKey: '...', projectId: '...', apiUrl: '...' }}>\n      <MyComponent />\n    </FeatureFlagsProvider>\n  );\n}\n\nfunction MyComponent() {\n  const { enabled, loading } = useFeatureFlag('my-feature');\n\n  if (loading) return null;\n  return enabled ? <NewUI /> : <OldUI />;\n}\n```\n\n### OpenFeature\n\n```ts\nimport { OpenFeature } from '@openfeature/server-sdk';\nimport { SignalServerProvider } from '@code-signal/signal';\n\nawait OpenFeature.setProviderAndWait(\n  new SignalServerProvider({\n    apiKey: process.env.SIGNAL_API_KEY,\n    projectId: process.env.SIGNAL_PROJECT_ID,\n    apiUrl: process.env.SIGNAL_API_URL,\n  })\n);\n\nconst client = OpenFeature.getClient();\nconst enabled = await client.getBooleanValue('my-feature', false);\n```\n\n## Type-safe flag keys\n\nDefine your flags once and reference them safely across your codebase:\n\n```ts\nimport { createFeatureFlag } from '@code-signal/signal';\n\nexport const FLAGS = {\n  NEW_CHECKOUT: createFeatureFlag('new-checkout'),\n  DARK_MODE: createFeatureFlag('dark-mode'),\n} as const;\n\n// Usage\nconst enabled = await signal.isEnabled(FLAGS.NEW_CHECKOUT);\n```\n\n## Real-time updates\n\nEnable WebSocket sync to receive flag changes instantly without polling:\n\n```ts\nawait initializeClient({\n  // ...\n  websocket: { enabled: true },\n  onUpdate: (flags) => console.log('Flags updated:', flags),\n});\n```\n\n## Configuration\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `apiKey` | `string` | required | Your Signal API key (`sig_live_...`) |\n| `projectId` | `string` | required | Your Signal project ID |\n| `apiUrl` | `string` | required | Signal API base URL |\n| `environment` | `string` | `production` | Target environment |\n| `syncInterval` | `number` | `30000` | Polling interval in ms (server) |\n| `websocket.enabled` | `boolean` | `false` | Enable real-time WebSocket sync |\n| `analytics.enabled` | `boolean` | `false` | Enable analytics tracking |\n| `abTesting.enabled` | `boolean` | `false` | Enable A/B testing |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}