> For the complete documentation index, see [llms.txt](https://docs.keyless.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyless.io/web-sdk/web-sdk-reference/camera-permission-flow.md).

# Camera Permission Flow

In order to provide a better user experience we include a page that takes care of explaining why the camera permission must be granted, and to block the user attempt to authenticate or enroll if they have already denied the camera permission.

The underlying logic uses the [Permissions query method](https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query) to check if the user has granted the camera permission or not.&#x20;

Note, this API is not supported by some older browsers, therefore we implemented a secondary flow to perform this check. In these instances the user will always see the camera permission page the first time they use the Web SDK on that website, but the check will still be performed in an elegant way. The result of this check will be stored in the sessions torage.

The camera permission page can always be skipped by setting the aforementioned session storage item, we expose a function from the `@keyless/sdk-web` package called `setKeylessPermissionsStorageItem` which accepts an object with the following structure:

| **Key**  | **Type**                                       |
| -------- | ---------------------------------------------- |
| `camera` | `{ state: "denied" \| "granted" \| "prompt" }` |
|          |                                                |

The session storage item can also be manually set without using this function, the key of the item is `kl-permission` .

{% hint style="info" %}
It is highly recommended to use our `setKeylessPermissionsStorageItem` function.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.keyless.io/web-sdk/web-sdk-reference/camera-permission-flow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
