The `supertokens-js-override` package provides foundational helper functions for implementing overrideable interfaces within the SuperTokens ecosystem. Its primary purpose is to enable developers to deeply customize the behavior of SuperTokens SDKs, allowing for the injection of custom logic into authentication and session management processes. This includes modifying how specific functions operate or altering the behavior of exposed APIs. While the package itself is at version `0.0.4`, it serves as a stable, internal dependency for other SuperTokens SDKs (like `supertokens-node` and `supertokens-auth-react`), which are more actively developed. Its release cadence is consequently very slow, as its core utility is mature. Key differentiators include its tight integration with SuperTokens' architecture, enabling method overriding akin to object-oriented `super` calls, and its support for complex customization scenarios directly within the application's backend or frontend code, rather than through external configuration dashboards.
npm install supertokens-js-overrideVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `buildOverride` to create a new object that modifies specific methods of an `originalService` while retaining others.
Consult the specific SuperTokens SDK documentation (e.g., `supertokens-node` or `supertokens-auth-react`) for the recommended way to use the `override` feature, which often involves passing an object directly to the recipe's `init` method.
Always pin to a specific `0.0.x` version (e.g., `"supertokens-js-override": "0.0.4"`) and review release notes thoroughly before upgrading, especially if directly using `buildOverride`. For indirect usage via other SuperTokens SDKs, follow their upgrade guides.
Ensure the `originalImplementation` object provided to `buildOverride` indeed contains the method being called in the override. Verify the type `T` matches the expected interface for the original implementation. Ensure `originalImplementation` is not `undefined` or `null`.
Double-check that the `override` function returns an object that either entirely replaces the method or correctly calls `originalImplementation.methodName` as part of its new logic. Ensure the result of `buildOverride` is then used where the modified interface is expected.
No dependency data recorded yet.