Skip to content

Commit

Permalink
Merge pull request #198 from lumapps/chore/fix-typos-in-sdk-docs
Browse files Browse the repository at this point in the history
chore(sdk): fix additional typos in the SDK documentation
  • Loading branch information
beroussel authored Sep 2, 2024
2 parents 7151467 + e9eab69 commit 931180a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ make docs-serve
Then to deploy the doc you can run

```bash
make doc-deploy
make docs-deploy
```


Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ make docs-serve
Then to deploy the doc you can run

```bash
make doc-deploy
make docs-deploy
```


Expand Down
20 changes: 2 additions & 18 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,9 @@ The first thing you'll need in order for you to be able to use the LumApps Api i

You can see them [here](https://apiv1.lumapps.com/#tag/Authentication)

The LumApps sdk can help you when using a service account or a regular token, all you have to do is to give the sdk the credentials infos and the subsequent calls made by the tool will be authenticated using those credentials.
The LumApps SDK requires an OAuth application to be set up on your LumApps platform (see how to do that in the [LumApps Developer Portal](https://developer.lumapps.com/documentation/oauth.html). Once it is done, all you have to do is to give the sdk the credentials infos and the subsequent calls made by the tool will be authenticated using those credentials.

Be sure to target the right lumapps environment. Refer to the [environment documentation](https://lumapps.github.io/lumapps-sdk/environment) first.

## Using a regular token

To authenticate with a regular, short lived accesss token, instantiate the sdk like so:

```python
from lumapps.api.base_client import BaseClient

client = base_client = BaseClient(
api_info={"base_url": "https://your-cell.api.lumapps.com"},
auth_info={
"client_id": "your-client-id",
"client_secret": "your-client-secret"
}
)
```
Be sure to target the right LumApps environment. Refer to the [environment documentation](https://lumapps.github.io/lumapps-sdk/environment) first.

## Using an application

Expand Down
27 changes: 9 additions & 18 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lumapps SDK

<p align="center">
<p style="text-align:center">
<a href="https://github.com/lumapps/lumapps-sdk/actions?query=workflow%3ACI"><img alt="Action Status" src="https://github.com/lumapps/lumapps-sdk/workflows/CI/badge.svg"></a>
<a href="https://pypi.org/project/lumapps-sdk/"><img alt="Pypi" src="https://img.shields.io/pypi/v/lumapps-sdk"></a>
<a href="https://codecov.io/gh/lumapps/lumapps-sdk/branch/master"><img alt="Coverage" src="https://codecov.io/gh/lumapps/lumapps-sdk/branch/master/graph/badge.svg"></a>
Expand All @@ -9,7 +9,7 @@
</p>


LumApps SDK is a set of tools to manipulate the [LumApps API](https://api.lumapps.com/docs/start)
LumApps SDK is a set of tools to manipulate the [LumApps API](https://apiv1.lumapps.com/)

This includes:

Expand All @@ -29,29 +29,20 @@ Python >= 3.8

## Getting started

1. Get your token
1. Set up your OAuth application

LumApps supports multiple ways of authentication.
The fastest one to implement is the following:

Get your token by logging to your LumApps account.
Once connected on your platform, open the javascript console of your browser and run:

```javascript
fetch(window.location.origin+"/service/user/token", {method: "POST"})
.then(data => {return data.json()})
.then(res => {console.log(res.token)});
```

This will generate your personal LumApps token that will be active for 60 minutes, and that we will use in the following steps
Before anything else, you need to set up an OAuth application by following the steps in the [LumApps Developer Portal](https://developer.lumapps.com/documentation/oauth.html).

2. Authenticate

Once your application set up, get a hand on its client ID and secret, then you can write the following
to get an access token for a particular user.
```python
from lumapps.api import BaseClient

token = "MY TOKEN"
base_client = BaseClient(
api_info={"base_url": "https://go-cell-001.api.lumapps.com"},
api_info={"base_url": "https://your-cell.api.lumapps.com"}, # e.g. "https://go-cell-001.api.lumapps.com"
auth_info={
"client_id": "your-client-id",
"client_secret": "your-client-secret"
Expand All @@ -76,7 +67,7 @@ The SDK documentation is available [here](https://lumapps.github.io/lumapps-sdk/

## Code convention

Docstring in PEP 484 type annotations format adapted to python 2.7 using comments.
Docstring in PEP 484 type annotations format adapted to python 3.x using comments.

## How to get help, contribute, or provide feedback

Expand Down

0 comments on commit 931180a

Please sign in to comment.