> For the complete documentation index, see [llms.txt](https://prisma-util.gitbook.io/stable/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prisma-util.gitbook.io/stable/modules/project-toolchain/extensions.md).

# Extensions

<details>

<summary>Versioning History</summary>

**API Version v2.0.0** - Introduced `prisma-util/toolchain/extensions` export.

</details>

To use extensions generated by Prisma Util, you just have to import them like this:

{% code title="Import Statement" %}

```javascript
import { desiredImports } from "prisma-util/toolchain/e/[FEATURExtensions_NAME]";
```

{% endcode %}

The `[FEATURE_NAME]` section is replaced by the name of the feature that you want to import.&#x20;

The list of available imports is dynamic and based on what features you've enabled in your configuration file. All features that make use of Project Toolchain's Extension API will display a notice on their page and the name of their exports.&#x20;

For standardization purposes, **all** features making use of Project Toolchain's Extension API will follow these naming conventions to ensure a smoother developer experience:

* `[FEATURE_NAME]` will always be lowercase and spaces will be replaced with hyphens.
* Based on the number of extensions, the feature will export:
  * If there is only one extensions for this feature, it will be the default export for `prisma-util/toolchain/extensions/[FEATURE_NAME]/index.js`.
  * If there are more than two extensions for this feature, they will be exported individually and the default export for this file will be an [ExportedExtensionsBase](#exportedextensionsbase) object.&#x20;

## Types & Definitions

### ExportedExtensionsBase

This type represents an object with the following TypeScript definition:

{% code title="ExportedExtensionsBase" %}

```typescript
declare type ExportedExtensionsBase = {
    [extensionName in AvailableExtensions]: (prisma: PrismaClient) => Omit<PrismaClient, "$use" | "$unuse">;
} & {
    /**
     * Add all extensions defined in this folder.
     * 
     * @param prisma The instance of the PrismaClient that will be modified.
     * @returns The PrismaClient with all extensions added.
     */
    all: (prisma: PrismaClient) => Omit<PrismaClient, "$use" | "$unuse">;
};
```

{% endcode %}

The key of this object will be the extension name (this is set by each feature that makes use of Project Toolchain's Extensions API and documented on the specific page of said feature) and the value will be a function. This function takes your PrismaClient as a parameter, so it can initialize all the values required and will return an extension that you can use in PrismaClient's `$extends` function.

This type also has a function (`add`) that will add all of the extensions for this feature to your PrismaClient and return the provided instance of this client.
