tRPCttRPC
Powered by
pedroP
tRPC•3y ago•
1 reply
pedro

Vanilla Client Authentication

How to authenticate using the vanilla client? I want to consume this route as the authenticated user, but I couldn't find how to do this. Everything's working fine but this. Couldn't find anything on the docs

export const edgeClient = createTRPCProxyClient<AppRouter>({
  links: [
    httpBatchLink({
      url: `${getBaseUrl()}/api/trpc`,
    }),
  ],
  transformer: SuperJSON,
});
export const edgeClient = createTRPCProxyClient<AppRouter>({
  links: [
    httpBatchLink({
      url: `${getBaseUrl()}/api/trpc`,
    }),
  ],
  transformer: SuperJSON,
});


  const introspect = await edgeClient.dataset.introspect.query(
    {
      datasetId: datasourceId,
      workspaceId,
    },
    {
      context: {
        session,
      },
    },
  );
  const introspect = await edgeClient.dataset.introspect.query(
    {
      datasetId: datasourceId,
      workspaceId,
    },
    {
      context: {
        session,
      },
    },
  );
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Vanilla Client Error Handling
justindgmJjustindgm / ❓-help
3y ago
TRPC Vanilla Client (T3 stack)
meowMmeow / ❓-help
3y ago
Trpc Vanilla client producing ts errors
MaxMMax / ❓-help
4y ago