You've already forked npm-core-sdk
Latest publish
This commit is contained in:
2
.npmrc
Normal file
2
.npmrc
Normal file
@@ -0,0 +1,2 @@
|
||||
@reflex-platform:registry=https://git.dev.reflex-platform.com/api/packages/reflex-platform/npm/
|
||||
//git.dev.reflex-platform.com/api/packages/reflex-platform/npm/:_authToken="11177f1f316afadeca69c5cabe3e273ea1b2ed3f"
|
||||
51
README.md
51
README.md
@@ -0,0 +1,51 @@
|
||||
# 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.
|
||||
|
||||
```js
|
||||
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.core.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.core.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](https://git.dev.reflex-platform.com/reflex-platform/vue-rp-example)
|
||||
|
||||
## Additional Resources
|
||||
|
||||
For more information on using the Reflex Platform SDK, please refer to the [documentation](https://docs.viz.dev.reflex-platform.com).
|
||||
|
||||
## License
|
||||
|
||||
This SDK is licensed under **MIT License**.
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
"name": "@reflex-platform/npm-core-sdk",
|
||||
"version": "1.13.0-SNAPSHOT-260407085736",
|
||||
"description": "npm libs from core model proto files",
|
||||
"homepage": "",
|
||||
"homepage": "https://git.dev.reflex-platform.com/reflex-platform",
|
||||
"main": "index.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": ""
|
||||
"url": "git+https://git.dev.reflex-platform.com/reflex-platform/npm-core-sdk.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
|
||||
Reference in New Issue
Block a user