> For the complete documentation index, see [llms.txt](https://docs.human-id.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.human-id.org/web-sdk-integration-guide/example-web-sdk-integration.md).

# Example Web SDK Integration

## Developer Console&#x20;

Acquire CLIENT-ID, CLIENT-SECRET, and set-up redirect URLs on the App Details page by registering your app through <https://developers.human-id.org/home/>.

## WebLoginUrl API Call

Create a view function that will perform a POST API request and render HTML:

```python
#YOUR_APP/views.py
def homepage(request):
    headers = {'client-id':'CLIENT_ID','client-secret':'CLIENT_SECRET'}
    response=requests.post('https://core.human-id.org/v0.0.3/server/users/web-login',headers=headers)
    data=response.json()
    return render(request,'trial/homepage.html',
    {
        'data':data
    })
```

Create a HTML page:

```markup
<!YOUR_APP/templates/homepage.html>
{%block content%}
<div>
<p>{{data}}</p>
<p><a href={{data.data.webLoginUrl}}>{% include 'anonymous-login.svg.html'%}</a></p>
</div>
{%endblock%}
```

## Callback URL

After a user successfully logs in through humanID. The user will be redirected to the URL specified in the developer console on the App Details page.

Create a function that will take the exchange token in that URL and make another API request to acquire a unique User ID.

```python
#YOUR_APP/views.py
def callback(request):
    headers = {'client-id':'CLIENT_ID','client-secret':'CLIENT_SECRET'}
    token = request.GET.get('et')
    response= requests.post('https://core.human-id.org/v0.0.3/server/users/exchange',headers= headers,data={'exchangeToken':token})
    data=response.json()
    return render(request,'trial/callback.html',
    {
        'data':data
    })

```


---

# 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.human-id.org/web-sdk-integration-guide/example-web-sdk-integration.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.
