# Prismic parameters

> After you install the Prismic integration, these new parameter types are available for authors.

Source: https://docs.uniform.app/docs/integrations/content/prismic/prismic-parameters

## Prismic parameters

After you install the Prismic integration, the following
parameter types are available. You can use these to incorporate
content from Prismic into your components and compositions.

| Parameter type | Description |
| --- | --- |
| [Prismic document](#prismic-document) | Select a single document from Prismic. |

### Prismic Document

This parameter type allows a Uniform user to select a single
Prismic document.

#### Add parameter to component

To allow a user to select a document from Prismic,
you must add a parameter to a component. The parameter is used
to store the identifier to the selected document when the user
selects a document.

1. In Uniform, navigate to your component.
2. Add a new parameter using the parameter type **Prismic Document**.
3. The following values can be specified:

   | Name | Description |  |  |  |  |  |
   | --- | --- | --- | --- | --- | --- | --- |
   | Select Linked Source | Specifies which Prismic project is the source for the document that can be selected. |  |  |  |  |  |
   | Allowed document types | Specifies which document types will be available to select from when the parameter value is edited. You can select multiple document types to allow the user to select from a larger set of documents. |  |  |  |  |  |
   | Required | Indicates whether the value is required when the component is used. |  |  |  |  |  |
   | Click **Select**.<br>![](https://docs.uniform.app/images/integrations/content/prismic/use-parameters/prismic-document/edit-value-default.png) | Click the document you want to select.<br>![](https://docs.uniform.app/images/integrations/content/prismic/use-parameters/prismic-document/edit-value-filters.png)<br>> **About this step:**<br>><br>> A couple of filters are available. The dropdown allows you to filter by document type. The text box allows you to filter by document content. | Click **Accept** to save your selection.<br>![](https://docs.uniform.app/images/integrations/content/prismic/use-parameters/prismic-document/edit-value-selected.png) | You will see details about the document you selected, including the title and some metadata.<br>![](https://docs.uniform.app/images/integrations/content/prismic/use-parameters/prismic-document/edit-value-saved.png)<br>> **About this step:**<br>><br>> After your selection is saved, you are presented with the following options:<br>><br>> - If you want to edit the selected document in Prismic, click **Edit**.<br>> - If you want to deselect the document, click **Unlink**. |  |  |  |
   | The document that was selected. | The source key for the linked content source. |  |  |  |  |  |
   | In Prismic, get the following values:<br>- Access token (required if your API is secured)<br>- Repository ID | Add the following npm packages to your front-end application:<br>```<br>@prismicio/client<br>@uniformdev/canvas-prismic<br>prismic-dom<br>``` | In a text editor, open the file where you retrieve the<br>composition definition from Uniform.<br>> **About this step:**<br>><br>> You are looking for the code calls the async function<br>> `getComposition`. The code below assumes the<br>> object returned is set in a variable `composition`. | Add the following import statements:<br>```javascript<br>import { EnhancerBuilder, enhance } from '@uniformdev/canvas';<br>import { <br>    createPrismicEnhancer,<br>    PrismicClientList,<br>    CANVAS_PRISMIC_PARAMETER_TYPES,<br>} from '@uniformdev/canvas-prismic';<br>import * as Prismic from '@prismicio/client';<br>import PrismicDOM from 'prismic-dom';<br>``` | Add the following code:<br>```javascript<br>const endpoint = Prismic.getEndpoint('!!! YOUR PRISMIC REPOSITORY ID !!!');<br>const client = Prismic.createClient(endpoint, {<br>    accessToken: '!!! YOUR PRISMIC ACCESS TOKEN (OPTIONAL) !!!',<br>});<br>```<br>> **About this step:**<br>><br>> We recommend you moving the Prismic credentials to<br>> environment variables rather than hard-coding them in the<br>> front-end app. | Add the following code:<br>```javascript<br>const clientList = new PrismicClientList({ client });<br>const prismicEnhancer = createPrismicEnhancer({ clients: clientList });<br>``` | Add the following code:<br>```javascript<br>await enhance({<br>    composition,<br>    enhancers: new EnhancerBuilder().parameterType(<br>    CANVAS_PRISMIC_PARAMETER_TYPES, <br>    prismicEnhancer<br>    ),<br>    context: {},<br>});<br>```<br>> **About this step:**<br>><br>> This registers the enhancer to be used for any occurrence<br>> of the Prismic Document parameter. |
