{"bugs":{"url":"https://github.com/clerkinc/javascript/issues"},"dist":{"shasum":"aefa9383c07d222326c8af9110d1fcbc0b530c58","tarball":"https://registry.npmjs.org/@clerk/backend-core/-/backend-core-0.1.0-alpha.1.tgz","fileCount":403,"integrity":"sha512-23U6EDv3vNjJaPBbL/buRI4TcYzigiMEWtOhaqKck5ENleSzacXHVz4yjTZ1+LwyJIfj2B88EYdTqZC/Fql4Jg==","signatures":[{"sig":"MEUCIDZufVCZ5al4+EPJaj72n2WgWySvSXCe28B/g6axuOPWAiEA5dJw2GtCdniAmYuzFXkqOT9VvKfmFpBWt/kuNF8CD+g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":480794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6XEFCRA9TVsSAnZWagAA7WEP/0S3gB1SAg7oJUh8F29q\nTR7Y1At+IkOseRRiSckxdWO//Pahr6KG4Bq63VcmITLKnKdFzX7KDs/EerS3\nmbcIE+QNuGPdjD7o0ch5tKy0SLu/vZn9LMgOWSmZdy630iAyGCYJ6CekGv8C\nU0LHmaXCmbY6rZ72NybsWzrllBwksdfWCozcJ+686o8P4UU8aORf5jP7jfTc\nUzjttQ/AxdoHNDPl24SWqw0s8iRmCKCSSLEmP1MOOFYtxeA6F6ZQU0T2Zo6Q\nanuP5EJsAS1AkzceGSvT2I3yKi0iCTIYZQNv1ZIjzuSP1YNlnB1ZYD+ZoUpl\n0vEX1BuCzSSuVGm1/rEYRpKU24mc1r3YG6b4GI0j/vCax4c/0eIATVlNIGIi\nxc7avYVtp+TpEr1ZVxwiVlD/5uImd6e422+r4fKJuxT+Kmo+72vKZ0C9Y6HJ\nxPF+NpE+CXR4lnXs+ozSZx/PRhq06r8bEwwpc1JGsHNcSGQDB3Gu/3DZshDm\nRXoi1hMnz2H8j9dg4B1JU/QEQnr80M6rOKSGkYSDD4qM2Q/hf85wy1KfokdZ\nZf37Hv5MDVyyaXefT1yZfigzHJ+raRDtIv6CgLWCw+fsDPDmV3nkWt6tAofq\n2baNmtiSie6KsJPUhc396V3d87rkiUWORgD2hsueqxPNAL3ebFxr/a2BUzAh\nD86q\r\n=pOMw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"@clerk/backend-core","type":"module","module":"dist/mjs/index.js","readme":"<p align=\"center\">\n  <a href=\"https://clerk.dev/\" target=\"_blank\" align=\"center\">\n    <img src=\"../../docs/clerk-logo.svg\" height=\"50\">\n  </a>\n  <br />\n</p>\n\n# Clerk Backend Core SDK\n\n_Core Clerk API resources and authentication utilities for JavaScript environments._\n\n```diff\n! This package provides low-level utilities and is mostly used as the base for other Clerk SDKs.\n```\n\n## Usage\n\n```sh\nnpm install @clerk/backend-core\n# or\nyarn add @clerk/backend-core\n```\n\n## Architecture\n\n`@clerk/backend-core` contains all the logic for basic Clerk functionalities such as:\n\n- Determining the authentication state of a session.\n- Validating a Clerk token state.\n- Clerk API resource management.\n\nwithout being platform/environment specific.\n\n### How it works\n\nThis package is used as the base building block for Clerk JavaScript SDKs and environments. This is achieved by providing all the required business logic if only a few environment-specific utilities are implemented by the client.\n\n<p align=\"center\">\n  <a href=\"https://clerk.dev/\" target=\"_blank\" align=\"center\">\n    <img src=\"./docs/core-sdk.png\" height=\"350\">\n  </a>\n  <br />\n</p>\n\nIn essence, the client should supply these key functions in the Clerk [Base](./src/Base.ts#47) and [ClerkBackendAPI](./src/api/ClerkBackendAPI.ts) classes:\n\n1. Public key import `importKeyFunction`.\n2. JWT signature verification `verifySignatureFunction`.\n3. Base64 decoding `decodeBase64Function`.\n4. HTTP fetching utility for the API resource management `ClerkFetcher`.\n\nAfter supplying those in the `Base` and `ClerkBackendAPI` classes, you can use all the Clerk utilities required for the SDK business logic.\n\n### Creating a Base for a new SDK\n\n```ts\nconst importKey = async (jwk: JsonWebKey, algorithm: Algorithm) => {\n  //  ...\n};\n\nconst verifySignature = async (\n  algorithm: Algorithm,\n  key: CryptoKey,\n  signature: Uint8Array,\n  data: Uint8Array\n) => {\n  // ...\n};\n\nconst decodeBase64 = (base64: string) => {\n  // ...\n};\n\n/** Base initialization */\n\nconst examplePlatformBase = new Base(importKey, verifySignature, decodeBase64);\n```\n\nAfter creating the `Base` instance you can use core functions such as:\n\n```ts\nexamplePlatformBase.verifySessionToken(...);\n\nexamplePlatformBase.getAuthState(...);\n```\n\nThe `Base` utilities include the building blocks for developing any extra logic and middleware required for the target platform.\n\n### Clerk API Resources\n\nAPI resource management is also provided by this package through the [ClerkBackendAPI](./src/api/ClerkBackendAPI.ts) class. For more information on the API resources you can checkout the [resource documentation page](https://docs.clerk.dev/reference/backend-api-reference).\n\nTo use the Clerk Backend API wrapper in any JavaScript platform, you would need to provide some specific SDK information and an HTTP fetching utility. See more at the [ClerkBackendAPIProps](./src/api/ClerkBackendAPI.ts#17) implementation.\n","gitHead":"97dca3fa40feb5128c66555c7cc00d0b64211567","license":"MIT","scripts":{"test":"jest","build":"tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && ./moduleTypeFix","prebuild":"rimraf dist"},"_npmUser":{"name":"igneel64","email":"p.perlepes@gmail.com"},"homepage":"https://github.com/clerkinc/javascript/tree/main/packages/backend-core","deprecated":"This package has been deprecated - use @clerk/backend instead","repository":{"url":"git+https://github.com/clerkinc/javascript.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v16.13.1+x64 (darwin)","description":"<p align=\"center\">   <a href=\"https://clerk.dev/\" target=\"_blank\" align=\"center\">     <img src=\"../../docs/clerk-logo.svg\" height=\"50\">   </a>   <br /> </p>","directories":{},"maintainers":[{"name":"giannis-clerk","email":"giannis@clerk.dev"},{"name":"igneel64","email":"p.perlepes@gmail.com"},{"name":"chanioxaris","email":"haris@clerk.dev"},{"name":"agis-clerk","email":"agis@clerk.dev"},{"name":"colinclerk","email":"colin@clerk.dev"},{"name":"bradenclerk","email":"braden@clerk.dev"},{"name":"sokratis","email":"sokratis.vidros@gmail.com"},{"name":"yourtallness","email":"mark@clerk.dev"},{"name":"nikosdouvlis","email":"nikosdouvlis@gmail.com"}],"_nodeVersion":"16.13.1","dependencies":{"query-string":"^7.0.1","camelcase-keys":"^7.0.1","snakecase-keys":"^5.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"got":"^11.0.0","jest":"^27.4.5","nock":"^13.2.1","rimraf":"^3.0.2","ts-jest":"^27.1.2","node-fetch":"^2.6.0","typescript":"^4.5.2","@types/jest":"^27.0.3","@types/node":"^16.11.12","@types/node-fetch":"^2","@peculiar/webcrypto":"^1.2.3"},"_npmOperationalInternal":{"tmp":"tmp/backend-core_0.1.0-alpha.1_1642688773269_0.19409358706524782","host":"s3://npm-registry-packages"},"_id":"@clerk/backend-core@0.1.0-alpha.1","version":"0.1.0-alpha.1"}