{"_id":"@clientloop/client","_rev":"2-1b093458dfb50440953695e47f67ee60","name":"@clientloop/client","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@clientloop/client","version":"0.0.1","author":{"name":"ClientLoop, LLC"},"license":"See LICENSE file","_id":"@clientloop/client@0.0.1","maintainers":[{"name":"nr1e","email":"npmjs@nr1e.com"}],"dist":{"shasum":"ef4bcac4770466f6d57b112e09170d10aa5aa7f2","tarball":"https://registry.npmjs.org/@clientloop/client/-/client-0.0.1.tgz","fileCount":27,"integrity":"sha512-qTzlZGlmX8RWZmKuRjCRR7Zx8dqD7eiyGPfuQdepqKWal2TFnG78+mVSl2wvbW9T0GNNgxowhH2KNDuZaRFXug==","signatures":[{"sig":"MEQCIHUcIGnLdrqQTHNUlvxyRyWKEKinzReYnTohSWxk+O0CAiBMSGXEYm4dglnY9cGEZ1z0ELfg47zgMM413yKFIXQ6+g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":110769},"type":"module","_from":"file:clientloop-client-0.0.1.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js"},"./react":{"types":"./dist/react.d.ts","import":"./dist/react.js"}},"scripts":{"fix":"biome check --write .","fmt":"biome format --write .","test":"vitest run","build":"paraglide-js compile --project ./project.inlang --outdir ./src/paraglide && tsc","clean":"rm -rf dist","reset":"rm -rf dist && rm -rf node_modules","watch":"tsc -w","generate":"cd ../graph && pnpm generate-public && cd ../client-public && rm -f src/schema.generated.ts && pnpm dlx @gqty/cli --typescript --target src/schema.generated.ts ../graph/public.graphql && cd ../graph && pnpm clean-generated","prebuild":"biome check","machine-translate":"inlang machine translate --project project.inlang"},"_npmUser":{"name":"nr1e","email":"npmjs@nr1e.com"},"_resolved":"/private/var/folders/5g/rl4cm9z936z4vbl0zmvd50xh0000gn/T/5a1e486ddaeeb37e51fe9d88d7c66d5f/clientloop-client-0.0.1.tgz","_integrity":"sha512-qTzlZGlmX8RWZmKuRjCRR7Zx8dqD7eiyGPfuQdepqKWal2TFnG78+mVSl2wvbW9T0GNNgxowhH2KNDuZaRFXug==","_npmVersion":"11.6.2","description":"ClientLoop Client","directories":{},"_nodeVersion":"24.11.1","dependencies":{"gqty":"^3.6.0","valibot":"^1.3.1","@nr1e/client":"0.0.0","@nr1e/commons":"0.4.18","email-validator":"^2.0.4","libphonenumber-js":"^1.12.26"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.2.0","vitest":"^4.1.5","graphql":"^16.13.0","typescript":"^6.0.2","@inlang/cli":"^3.0.0","@types/node":"^24.10.13","@types/react":"^19.2.0","@biomejs/biome":"2.5.0","@graphql-codegen/cli":"^6.1.2","@inlang/paraglide-js":"^2.15.0"},"peerDependencies":{"react":"^19.2.0","react-dom":"^19.2.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/client_0.0.1_1782165346556_0.036969083634834865","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@clientloop/client","description":"ClientLoop Client","version":"0.0.2","type":"module","author":{"name":"ClientLoop, LLC"},"publishConfig":{"access":"public"},"license":"See LICENSE file","dependencies":{"@gqty/react":"3.2.0-canary-20251212122042.0328043df3bb682049f92aff7d44011011add364","email-validator":"^2.0.4","gqty":"^3.6.0","libphonenumber-js":"^1.12.26","valibot":"^1.3.1","@nr1e/commons":"0.4.18"},"peerDependencies":{"react":"^19.2.0","react-dom":"^19.2.0"},"peerDependenciesMeta":{"react":{"optional":true},"react-dom":{"optional":true}},"devDependencies":{"@biomejs/biome":"2.5.0","@graphql-codegen/cli":"^6.1.2","@types/node":"^24.10.13","@types/react":"^19.2.0","graphql":"^16.13.0","react":"^19.2.0","typescript":"^6.0.2","vite":"^7.3.1","vitest":"^4.1.5","@inlang/paraglide-js":"^2.15.0","@inlang/cli":"^3.0.0","@nr1e/client":"0.0.0"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./core":{"import":"./dist/core/index.js","types":"./dist/core/index.d.ts"},"./react":{"import":"./dist/react.js","types":"./dist/react.d.ts"}},"scripts":{"prebuild":"biome check","build":"paraglide-js compile --project ./project.inlang --outdir ./src/paraglide && vite build && tsc --emitDeclarationOnly","watch":"tsc -w","test":"vitest run","clean":"rm -rf dist","reset":"rm -rf dist && rm -rf node_modules","fix":"biome check --write .","fmt":"biome format --write .","generate":"cd ../graph && pnpm generate-public && cd ../client-public && rm -f src/schema.generated.ts && pnpm dlx @gqty/cli --typescript --target src/schema.generated.ts ../graph/public.graphql && cd ../graph && pnpm clean-generated","machine-translate":"inlang machine translate --project project.inlang"},"_id":"@clientloop/client@0.0.2","_integrity":"sha512-vrbt0kUI+OQJooDGBgZBkTwKawEqIdD5MVJVuS5t9eVqdi0DbtDUW/T0sCyoA9YW+e5d0oTrdKp6ucbKAdsTbg==","_resolved":"/private/var/folders/5g/rl4cm9z936z4vbl0zmvd50xh0000gn/T/55fa625fc99e1ca7d8a53da5f125ff48/clientloop-client-0.0.2.tgz","_from":"file:clientloop-client-0.0.2.tgz","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-vrbt0kUI+OQJooDGBgZBkTwKawEqIdD5MVJVuS5t9eVqdi0DbtDUW/T0sCyoA9YW+e5d0oTrdKp6ucbKAdsTbg==","shasum":"f4814344fdf403f80f0e766c773aae0c9f0f238b","tarball":"https://registry.npmjs.org/@clientloop/client/-/client-0.0.2.tgz","fileCount":88,"unpackedSize":642464,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCW0jJPCFqH60iIG5NbamcXuQWeGOb8K/1nRu2sArzKqAIgPZeNqbxqbAE2CXzBIXxSGVy5AB+bBQkIXT2EGQVZumk="}]},"_npmUser":{"name":"nr1e","email":"npmjs@nr1e.com"},"directories":{},"maintainers":[{"name":"nr1e","email":"npmjs@nr1e.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/client_0.0.2_1782180849085_0.9032164897638857"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-22T21:55:46.310Z","modified":"2026-06-23T02:14:09.499Z","0.0.1":"2026-06-22T21:55:46.696Z","0.0.2":"2026-06-23T02:14:09.363Z"},"author":{"name":"ClientLoop, LLC"},"license":"See LICENSE file","description":"ClientLoop Client","maintainers":[{"name":"nr1e","email":"npmjs@nr1e.com"}],"readme":"# @clientloop/client\n\nThe ClientLoop API client. A typed [GQty](https://gqty.dev) client for the\nClientLoop GraphQL API, plus thin helper functions and the shared validation\nschemas.\n\n## Installation\n\n```sh\nnpm install @clientloop/client\n# or\npnpm add @clientloop/client\n```\n\n`react` / `react-dom` are optional peer dependencies, required only when using\nthe `@clientloop/client/react` entry point.\n\n## Versioning\n\nThis package follows [semantic versioning](https://semver.org). Depend on it\nwith a caret range so you automatically pick up backward-compatible patch and\nminor releases, while breaking changes (a new major) require an explicit\nopt-in:\n\n```jsonc\n{\n  \"dependencies\": {\n    \"@clientloop/client\": \"^1.0.0\"\n  }\n}\n```\n\n`pnpm add @clientloop/client` writes a caret range by default. Note that a\nplain `pnpm install` honors the lockfile and won't move an already-resolved\nversion; run `pnpm update @clientloop/client` to pull the newest release\nwithin the range.\n\n## Usage\n\nCreate a client, then query the API through it. The client is a\n[GQty](https://gqty.dev) client — select the fields you want inside\n`client.resolve` and they are fetched for you:\n\n```ts\nimport { createClient } from '@clientloop/client';\n\n// Pass your API key — it is sent as an `Authorization: Bearer <apiKey>`\n// header on every request.\nconst client = createClient({ apiKey: process.env.CLIENTLOOP_API_KEY });\n\nconst region = await client.resolve(({ query: { info } }) => info.region);\n```\n\n`createClient(config?)` accepts an optional config:\n\n- `url` (optional) — the ClientLoop API endpoint. Defaults to the production\n  API, so you usually don't need to set it.\n- `apiKey` (optional) — sent as a `Bearer` token on every request.\n- `locale` (optional) — sets the locale used for this package's validation\n  messages.\n\n## React\n\nThe `@clientloop/client/react` entry wraps a client in\n[GQty](https://gqty.dev) React hooks. Create the client and hooks once (at\nmodule scope), then use `useQuery` in your components — selected fields are\nfetched and the component re-renders when they arrive:\n\n```tsx\nimport { createClient } from '@clientloop/client';\nimport { createReactGqtyClient } from '@clientloop/client/react';\n\nconst { useQuery } = createReactGqtyClient(createClient());\n\nexport function Region() {\n  const query = useQuery();\n  const region = query.info.region;\n\n  if (query.$state.isLoading) {\n    return <p>Loading…</p>;\n  }\n  return <p>Region: {region}</p>;\n}\n```\n\n`react` and `react-dom` must be installed (they are optional peer\ndependencies of this package).\n\n## Entry points\n\n| Import | Contents |\n| --- | --- |\n| `@clientloop/client` | `createClient`, the `Client` type, and `Locale`. |\n| `@clientloop/client/core` | Helper functions (e.g. `getInfo`, `getApplyConfiguration`, `applySessionCreate`, `contactCreateIdvSession`), the generated schema types, and the shared validation schemas/validators (`CommonSchema`, `safeValidateFirstError`, `isPoBoxOrPmbAddress`, the apply input-schema factories, …). |\n| `@clientloop/client/react` | `createReactGqtyClient` and the `ReactGqtyHooks` type for using the client with React. |\n\n## Validation schemas\n\nThe `/core` entry exports the [valibot](https://valibot.dev) schemas and\nvalidators used by ClientLoop's apply and checkout forms, so client-side form\nvalidation matches what the API enforces.\n\n## License\n\nSee the `LICENSE` file.\n","readmeFilename":"README.md"}