Connect a Source
A Source is a connection to an existing data source — a database, API, file store, or anything a Bridge can read from. Sources are scoped to an Environment and their credentials are stored encrypted per-organization.
What You'll Need
- A running SemiLayer environment (see Organization Setup)
- A bridge package for your data source type (e.g.
@semilayer/bridge-postgres) - Connection credentials (URL, API key, etc.)
Connect via the CLI
The wizard prompts for:
- Bridge — the package name (e.g.
@semilayer/bridge-postgres) - Source name — the identifier used in
sl.config.ts(e.g.main-db) - Connection details — URL or other bridge-specific config
After connecting, SemiLayer introspects the source and lists available tables, collections, or endpoints.
Connect via the Console
Settings → Sources → Connect source
Fill in the same fields. After saving, the Console shows the introspected targets and their schema (column names, types, estimated row count).
Reference in sl.config.ts
Once a source is connected, reference it by name in your config:
The connection string itself lives in the service (stored encrypted) — not in
sl.config.ts. Your config only references the bridge type and source name.
Available Bridges
| Data Source | Package |
|---|---|
| PostgreSQL | @semilayer/bridge-postgres |
| More — contribute yours | Bridge SDK |
Bridges are installed as npm packages. The worker resolves them at runtime via
@semilayer/bridge-resolver.
Multiple Sources
A single environment can have multiple sources. Each lens declares which source it reads from:
Managing Sources
Or from the Console: Settings → Sources.
Next Steps
With a source connected:
- Schema (Config) — define lenses over your source
- Push & Ingest — push the config and start indexing