> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# Using SurrealDB extensions

How to install a pre-built SurrealDB extension archive into SurrealDB: inspect its exports, check its signer, grant capabilities, and call its functions from SurrealQL.

You do not have to author Rust yourself to benefit from extensions. Many teams install a **pre-built `.surli` archive** produced by another team or pipeline, or a package published to Silo. Writing an extension means writing Rust, configuring `package.toml`, and running [`surreal ext build`](/docs/reference/cli/ext.md) yourself, as described in [Creating custom extensions](/docs/learn/extensions/guides/creating-custom-extensions.md). This page focuses on installing one.

## Inspecting an archive before use

If you receive an archive from another team, inspect it locally first:

```bash
surreal ext info demo.surli
surreal ext sig --fnc can_drive demo.surli
```

These commands show the functions it exports, their signatures, and whether each one can write.

## Storing the archive

SurrealDB needs access to the `.surli` file. Use [`DEFINE BUCKET`](/docs/reference/query-language/statements/define/bucket.md) to create or configure bucket storage, then upload the file according to your environment's path and permissions model. A Silo package needs no bucket, because the database fetches it from Silo.

## Installing the extension

[`surreal ext install`](/docs/reference/cli/ext.md#ext-install) reads the archive, shows who signed it, its digest, the functions it adds and the capabilities it requests, and asks which to accept before it defines the extension:

```bash
surreal ext install 'f"extensions:/demo.surli"' --as demo \
    -e ws://localhost:8000 -u root -p secret --ns app --db main
```

Confirm the signer's key fingerprint or CI identity with the team that published the archive before you accept it. In a script, pass the decisions as flags, such as `--trust-signer` and `--with-capability`.

The command runs a [`DEFINE EXTENSION`](/docs/reference/query-language/statements/define/extension.md) statement, which can also be written by hand when the signer and capabilities are already known.

## Calling functions from SurrealQL

After the extension is defined, call its functions through the name it was installed as, such as `ext::demo::can_drive(18)`. Consult the extension's documentation for exact names and parameters.

To move to a new version of the archive, upload it under a new file name and run [`surreal ext upgrade`](/docs/reference/cli/ext.md#ext-upgrade), which compares the new signer and capabilities with the installed ones before it redefines the extension.

## Further reading

- [Extension overview](/docs/learn/extensions/plugins/overview.md) - how compilation, buckets, and extensions fit together.
- [`DEFINE BUCKET` reference](/docs/reference/query-language/statements/define/bucket.md) - file storage for WASM.
- [`DEFINE EXTENSION` reference](/docs/reference/query-language/statements/define/extension.md) - `DIGEST`, `SIGNER` and `CAPABILITIES`.
