Integrating Ancho
Basic integration path
The process of integrating Ancho can be broken down into 3 basic steps:
Add the logic for creating new Ancho users
Choose an SDK
Integrate the SDK into your app
Creating new Ancho users
Once you have an Ancho account, you'll have access to both a Production and a Development API Key. These API Keys can be used to create new users in their respective environments.
Creating new users is as easy as making a POST request to the Ancho API with an Authorization header containing a Bearer value with your API Key.
const response = await fetch('https://api.ancho.io/v1/users', {
headers: {
Authorization: `Bearer ${YOUR_ENVIRONMENT_API_KEY}`,
},
method: 'POST'
})
const user = await response.json()client := &http.Client{}
req, err := http.NewRequest(
"POST",
"https://api.ancho.io/v1/users",
strings.NewReader(""),
)
if err != nil {
panic(err)
}
req.Header.Add("Authorization", "Bearer "+YOUR_ENVIRONMENT_API_KEY)
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}headers = {
'Authorization': f'Bearer {YOUR_ENVIRONMENT_API_KEY}',
}
response = requests.post('https://api.ancho.io/v1/users', headers=headers)
user = response.json()val client = HttpClient.newBuilder().build()
val request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ancho.io/v1/users"))
.header("Authorization", "Bearer $YOUR_ENVIRONMENT_API_KEY")
.POST(BodyPublishers.noBody())
.build()
val response = client.send(request, HttpResponse.BodyHandlers.ofString())Choosing an SDK
Ancho offers SDKs for Web, Android, and iOS to cover a wide variety of client-side implementations.
Integrating the SDKs
To integrate the SDK of your choice into your app, you can follow one of our Quick Start guides.
Last updated