> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/mobile/react-native/id-card-capture.md).

# ID Card Capture

## ID Card Capture

ID Card Capture will capture an id card image for a tag that may be provided during initiation and if not provided this will be auto generated by the SDK and returned with a code.

### Import the library <a href="#import-the-library" id="import-the-library"></a>

```
import RnSmileId from 'rn-smile-id';
```

### Capture ID Card <a href="#capture-selfie" id="capture-selfie"></a>

If you want the SDK to generate a tag for you then call the method with an empty string

```
const data = await RnSmileId.captureIDCard('',null);
```

If you want the generate to use a custom tag send a string to the SDK with alphanumeric characters with the exception of an underscore and no spacing in them.

```
const data = await RnSmileId.captureIDCard(<STRING_TAG>,null);
```

This will present a screen as belowID Card Capture

![](/files/-Mb0MKMqONlz0vvlkHPD)

### Get Results

The selfie capture process is an asynchronous process and will return an error code and a tag once done. The result looks as the below

```
const resultCode = data.SID_RESULT_CODE;
const resultTag = data.SID_RESULT_TAG;
```

�If the result code is -1 AND the tag is not null or empty then the selfie capture was successful.

### Optional UI Customisations

For basic UI customisation, an additional key-value object needs to be passed as second parameter when performing a call to the library's `captureSelfie(tag:"<TAG>",config:{"key":"value"}`)

`)` method, where `tag` is a string and `config` the added key-value Map containing the desired settings.

### Basic Example

* `id_capture_side`: a string value with options `0,1,2 0` being capture front only, `1` being capture front and back and `2` being capture back only
* `id_capture_orientation`: a string that determines the ***prompt*** text view on the selfie review screen; this text view refers to the one directly under the selfie image view

```
const config = {
  "id_capture_side": "0",
  "id_capture_orientation": "2"
};

RNSmileRnLib.captureIDCard(tag, config);
```


---

# 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://legacy-docs.usesmileid.com/integration-options/mobile/react-native/id-card-capture.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.
