API Client
createClient
createClientimport { createClient } from '@opencrvs/toolkit/api'
function createClient(
baseUrl: string,
token: `Bearer ${string}`
): TRPCClientParameter
Type
Description
Method
Description
import { createClient } from '@opencrvs/toolkit/api'
import { aggregateActionDeclarations } from '@opencrvs/toolkit/events'
const client = createClient(`${process.env.GATEWAY_HOST}/events`, `Bearer ${token}`)
const event = await client.event.get.query({ eventId })
const state = aggregateActionDeclarations(event)
const childNid = state['child.nid'] as stringLast updated