Fabriq
1.x
Docs/Fabriq/Connection String
Open

Reading2 min
Updated2 Aug 2026
Sourcev1/(admin)/connection-string.mdx

A fabriq connection string points a client at a hosted fabriq instance the way postgres://… points at a database — one portable token carrying the endpoint, tenant, credential, and transport. It collapses the scattered "base URL + tenant header + Bearer key" config into a single string, and it is verified by the API-key layer.

Grammar01

fabriq://<key>@<host>[:<port>][/<tenant>][?tls=&version=&basePath=]
fabriq+grpc://…          # reserved; the gRPC transport is not built yet
  • schemefabriq selects HTTP/JSON over the adminapi. fabriq+grpc is parsed and reserved.

  • userinfo — the API key (the sole credential).

  • host[:port] — port defaults to 443 under TLS, else 80. localhost / 127.0.0.1 default to no-TLS; ?tls=true|false overrides.

  • path — an optional tenant. For a tenant-bound key it is display/override (the server validates it); for a multi-tenant key it becomes the X-Tenant-ID selector.

  • querytls, version (default 1), basePath (default /admin).

TypeScript — connect()02

connect() in @fabriq/admin-sdk turns a DSN into a ready FabriqClient, wiring the Authorization: Bearer, X-Tenant-ID, and X-Fabriq-Api-Version headers from the string:

import { connect } from "@fabriq/admin-sdk"

const client = connect("fabriq://fq_live_…@fabriq.internal/acme-corp")
const page = await client.listEntities({ type: "order", limit: 20 })

The console uses the same path: set VITE_FABRIQ_DSN and it builds its client via connect().

Go — the client package03

github.com/xraph/fabriq/client is a standalone Go client that mirrors the entire adminapi surface — entities, types/schema, search, vector, spatial, graph, files, CRDT, events, cache, projections, distillation, commands, recall, raw query, capabilities, and migrations:

import "github.com/xraph/fabriq/client"

c, err := client.Connect(ctx, "fabriq://fq_live_…@fabriq.internal/acme-corp")
if err != nil {
    return err
}

page, err := c.ListEntities(ctx, client.ListEntitiesParams{Type: "order", Limit: 20})
hits, err := c.SearchText(ctx, client.SearchTextParams{Type: "order", Q: "refund"})

It sets the Bearer/tenant/version headers on every request and maps a non-2xx response to a typed *client.APIError carrying the HTTP status. This is the client weave and cortex use to reach a remote fabriq as a vector store and a living brain.

Warning

A connection string embeds a secret in a URL — treat it like a postgres:// DSN. Keep tokens revocable and per-tenant, and prefer supplying them from the environment or a secret store over inlining them.