Reflex Platform Core SDK
This is the official NPM Core SDK for Reflex Platform. It provides client stubs for interacting with Reflex Platform APIs through gRPC.
Usage
Import the SDK in your JavaScript or TypeScript project and use it to communicate with Reflex Platform services.
import { ProjectServiceClient, GetMyUIContextRequest } from '@reflex-platform/npm-core-sdk';
import { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'
import { type RpcOptions, type RpcInterceptor, UnaryCall } from "@protobuf-ts/runtime-rpc";
const authInterceptor : RpcInterceptor = {
interceptUnary(next, method, input, options: RpcOptions): UnaryCall {
options.meta["Authorization"] = "Bearer YOUR_TOKEN";
return next(method, input, options);
}
}
const coreTransportInstance = new GrpcWebFetchTransport({
baseUrl: "grpc.viz.dev.reflex-platform.com:443",
interceptors: [authInterceptor]
});
const client = new ProjectServiceClient(coreTransportInstance);
const contexts = await client.GetMyUIContext(new GetMyUIContextRequest());
gRPC Endpoint
The SDK connects to the following gRPC endpoint:
grpc.viz.dev.reflex-platform.com
Example Vue.js Application
A more complete Vue.js application that demonstrates how to integrate the Reflex Platform NPM SDK is available. This serves as a reference implementation for using the SDK in a frontend application.
Repository: Vue RP Example
Additional Resources
For more information on using the Reflex Platform SDK, please refer to the documentation.
License
This SDK is licensed under MIT License.
Description
Languages
TypeScript
100%