Skip to content

Commit 5ca3afc

Browse files
authored
Merge pull request #12 from getyoti/Tidy-Up-README
[SDK-163]: Tidy up readme
2 parents 7300005 + 496a442 commit 5ca3afc

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Please feel free to reach out
4343
13) [Version Support](version-support) -
4444
Extra information on ensuring correct version of Python is being used
4545

46-
## An Architectural view
46+
## An Architectural View
4747

4848
Before you start your integration, here is a bit of background on how the integration works. To integrate your application with Yoti, your back-end must expose a GET endpoint that Yoti will use to forward tokens.
4949
The endpoint can be configured in the Yoti Dashboard when you create/update your application. For more information on how to create an application please check our [developer page](https://www.yoti.com/developers/documentation/#login-button-setup).
@@ -79,7 +79,7 @@ To import the Yoti SDK inside your project, simply run the following command fro
7979
$ pip install yoti
8080
```
8181

82-
## SDK Project import
82+
## SDK Project Import
8383

8484
You can reference the project URL by adding the following import:
8585

@@ -113,21 +113,31 @@ def auth():
113113
activity_details = client.get_activity_details(request.args['token'])
114114
```
115115

116-
## Profile Retrieval
116+
## Handling Users
117117

118-
When your application receives a token via the exposed endpoint (it will be assigned to a query string parameter named `token`), you can easily retrieve the user profile by adding the following to your endpoint handler:
118+
When you retrieve the user profile, you receive a user ID generated by Yoti exclusively for your application.
119+
This means that if the same individual logs into another app, Yoti will assign her/him a different ID.
120+
You can use this ID to verify whether (for your application) the retrieved profile identifies a new or an existing user.
121+
Here is an example of how this works:
119122

120123
```python
121-
activity_details = client.get_activity_details(request.args['token'])
122-
user_profile = activity_details.user_profile
123-
return render_template('profile.html',
124-
**user_profile)
125-
124+
client = Client(YOTI_CLIENT_SDK_ID, YOTI_KEY_FILE_PATH)
125+
user_profile = client.get_activity_details(token).user_profile
126+
127+
user_id = user_profile.get('user_id')
128+
selfie = user_profile.get('selfie')
129+
given_names = user_profile.get('given_names')
130+
family_name = user_profile.get('family_name')
131+
phone_number = user_profile.get('phone_number')
132+
date_of_birth = user_profile.get('date_of_birth')
133+
postal_address = user_profile.get('postal_address')
134+
gender = user_profile.get('gender')
135+
nationality = user_profile.get('nationality')
126136
```
127137

128-
## Running the examples
138+
## Running the Examples
129139

130-
Both example applications utilise the env variables described above, make sure they are accessible.
140+
Both example applications utilise the env variables described in [Configuration](#configuration), make sure they are accessible.
131141

132142
* Installing dependencies: `pip install -e .[examples]`
133143

@@ -144,7 +154,7 @@ Both example applications utilise the env variables described above, make sure t
144154

145155
Plugins for both Django and Flask are in the `plugins/` dir. Their purpose is to make it as easy as possible to use the Yoti SDK with those frameworks. See their respective `README` files for details.
146156

147-
## Running the tests
157+
## Running the Tests
148158

149159
Run your project but please make sure you have all the correct requirements:
150160

@@ -208,7 +218,7 @@ Supporting multiple Python versions with dependencies, often requiring compilati
208218

209219
For Python versions that do not provide binary wheels for `cryptography`, it will have to be compiled. This will be done automatically, however, you may need to install development headers of `openssl`.
210220

211-
##### On Debian-based systems #####
221+
##### On Debian-based Systems #####
212222

213223
Install `openssl` headers with `apt-get install openssl-dev`
214224

0 commit comments

Comments
 (0)