Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 705 Bytes

README.md

File metadata and controls

35 lines (28 loc) · 705 Bytes

Magickbase Web3 Platform API

Usage with TRPC

import { TRPCRouter } from '@magickbase/p';
import { createTRPCClient, httpBatchLink } from '@trpc/client';
import SuperJSON from 'superjson';

const client = createTRPCClient<TRPCRouter>({
  links: [
    httpBatchLink({
      url: `https://api-endpoint.domain/api/trpc`,
      transformer: SuperJSON,
      headers: {
        Authorization: `Bearer <my-token>`,
      },
    }),
  ],
});

If you are using TypeScript we recommend using TRPC to interact with the API for a better development experience.

Import this Repo

{
  "dependencies": {
    "@magickbase/p": "github:<org>/web3platform"
  }
}