@rebuy/hydrogen-sdk
Version:
The React/Hydrogen wrapper for the Rebuy Core SDK.
22 lines (21 loc) • 900 B
TypeScript
import { RebuySDK } from '@rebuy/core-sdk';
export declare const RebuyContext: import("react").Context<RebuySDK | null>;
/**
* RebuyProvider - React context provider for Rebuy SDK
*
* @param {object} props - Component props
* @param {*} props.children - Child components that will have access to Rebuy SDK
* @param {string} props.apiKey - Rebuy API key for authentication
* @param {string} props.apiHost - Optional API host override (defaults to Rebuy's host)
* @param {string} props.nonce - Optional nonce for CSP (Content Security Policy)
*/
export declare const RebuyProvider: ({ apiHost, apiKey, children, nonce, }: {
apiHost?: string;
apiKey: string;
children: React.ReactNode;
nonce?: string;
}) => import("react/jsx-runtime").JSX.Element;
/**
* Hook to access the Rebuy SDK instance from context.
*/
export declare const useRebuy: () => RebuySDK;