Manage connectors
Note
For each command, you can append --path /your/path/to/logto
(alias -p
) to specify the Logto instance path.
If the working directory at the root of a Logto project, you can skip using the --path
option as the CLI will automatically detect it.
List existing connectorsโ
Use the command below to list existing connectors that have been added to your Logto instance:
- CLI
- Local
- npx
logto connector list
npm run cli connector list
npx @logto/cli connector list
A sample output:
OFFICIAL
@logto/connector-alipay-native
@logto/connector-aliyun-dm
@logto/connector-aliyun-sms
@logto/connector-apple
@logto/connector-azuread
3RD-PARTY
connector-some-third-party
Add connectorsโ
Official connectorsโ
All official connectors are listed in @logto/connectors, except those names that start with connector-mock-
for testing purposes.
Every connector is a Tier 1 Bounty Hunter issue by default. Feel free to comment on or create the related GitHub issue for acknowledging a connector if you are interested.
If you are using the official Logto release (Docker image, Docker Compose, download from GitHub release page, or init via CLI), there's no need to manually add official connectors.
- CLI
- Local
- npx
logto connector add --official
npm run cli connector add --official
npx @logto/cli connector add --official
Third-party connectorsโ
Third-party connectors are those made for Logto but NOT in @logto/connectors.
The connector to add should be a valid NPM package, and the package name must start with connector-
or @some-org/connector-
. E.g.:
- CLI
- Local
- npx
logto connector add service-a connector-service-b @org/service-c
# is equal to
logto connector add connector-service-a connector-service-b @org/connector-service-c
npm run cli connector add service-a connector-service-b @org/service-c
# is equal to
npm run cli connector add connector-service-a connector-service-b @org/connector-service-c
npx @logto/cli connector add service-a connector-service-b @org/service-c
# is equal to
npx @logto/cli connector add connector-service-a connector-service-b @org/connector-service-c
Connectors are executable code! Inspect and review the COMPILED CODE (the content download from NPM) very, very carefully to avoid potential security issues if you are trying to use a third-party connector.
Remember to restart your Logto instance to get the changes reflected.
Link local connectorsโ
Logto also comes with a set of prebuilt connectors in the <logto-root>/pacakges/connectors
of your Logto instance directory. They are linked to the core service by default, which you can manually link again for updates (e.g. add a new local connector).
- CLI
- Local
- npx
logto connector link
npm run cli connector link
npx @logto/cli connector link
This command will create symbolic links of every connector in <logto-root>/packages/connectors
to <logto-root>/packages/core/connectors
. If a connector with the same name already exists in packages/core/connectors
, it will be removed first.
Remove connectorsโ
- CLI
- Local
- npx
logto connector remove connector-service-a @org/connector-service-b
npm run cli connector remove connector-service-a @org/connector-service-b
npx @logto/cli connector remove connector-service-a @org/connector-service-b
Remember to restart your Logto instance to get the changes reflected.