synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
42 lines • 1.73 kB
TypeScript
import { PropsWithChildren } from 'react';
import { AuthenticationRequest } from '@sage-bionetworks/aridhia-client/generated/models';
export type AridhiaContextType = {
/**
* Base URL for the Aridhia Gateway API.
* All API calls, including FAIR API calls, should go through the gateway.
* For FAIR API calls, the gateway routes to /fair/<api path>
*/
apiBasePath: string;
/**
* Authentication request parameters for token exchange (excluding subject_token)
*/
authenticationRequest: Omit<AuthenticationRequest, 'subject_token'>;
};
export type AridhiaContextProviderProps = PropsWithChildren<{
/**
* Base URL for the Aridhia Gateway API.
* All API calls should go through this gateway.
* @default 'https://gateway.westeurope.dap.c-path.org'
*/
apiBasePath?: string;
/**
* Authentication request parameters for token exchange
*/
authenticationRequest: Omit<AuthenticationRequest, 'subject_token'>;
}>;
/**
* Context provider that stores Aridhia API configuration.
* Token exchange is handled by individual hooks/queries to ensure fresh tokens.
*/
export declare function AridhiaContextProvider(props: AridhiaContextProviderProps): import("react/jsx-runtime").JSX.Element;
/**
* Hook to access the Aridhia context containing the access token
* @throws Error if used outside of AridhiaContextProvider
*/
export declare function useAridhiaContext(): AridhiaContextType;
/**
* Hook to access the Aridhia context, returning undefined if not within a provider.
* Useful for optional Aridhia integration.
*/
export declare function useAridhiaContextOptional(): AridhiaContextType | undefined;
//# sourceMappingURL=AridhiaContext.d.ts.map