Skip to content

Commit

Permalink
#11 Changes to docs to include auth_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Slations authored Feb 22, 2022
1 parent 688f946 commit 504669f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ Personally I perfer to set the namespace when creating a new instance as I think
There are currently four config options a user can set, these need to be set in the order below. Options with a start by the title are required the rest are optional.

```
$directus = new Slations\DirectusSdk\Directus(option1*, option2, option3, option4);
$directus = new Slations\DirectusSdk\Directus(option1*, option2*, option3, option4, option5);
```

### Option 1* | Set API URL

You set the root URL to your directus installation, this field is required for the SDK to work.

### Option 2* | Set Auth Prefix

### Option 2 | Set Auth Storage
You set the auth prefix for your directus instance, this is so the SDK can differentiate between two instances running in parallel

### Option 3 | Set Auth Storage

The default is currently `_SESSION` but can be changed the the following options to fit the end users needs.

Expand All @@ -61,12 +64,12 @@ The default is currently `_SESSION` but can be changed the the following options
`_COOKIE` - This stores the three Auth variables in Cookies on the client-side but will still store and use PHP Session on the server-side due to limitations in PHP Cookie support. This can be useful if you need to retreve the access token from JS using cookies.


### Option 3 | Set Auth Domain
### Option 4 | Set Auth Domain

This one is only used if option 2 has been set to `_COOKIE`. This sets the root auth domain of the cookie. By default it is `/` so it applies to the whole site but can be set to a folder if you only want the user to be authenticated in the subdirectory.


### Option 4 | Set Strip Headers
### Option 5 | Set Strip Headers

This option is mainly for development which is why it has been put at the end but the request passed back to the user can contain the headers as well as the content in the array. The default value is `true` but can be set to `false` if you need access to the headers of the request.

Expand Down

0 comments on commit 504669f

Please sign in to comment.