Skip to content

Commit

Permalink
Updated Intercom.nuspec and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gonace committed Jun 27, 2023
1 parent b2f8780 commit 558ffb0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Intercom/Intercom.nuspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Intercom</id>
<id>Intercom.NET</id>
<title>Intercom</title>
<version>$version$</version>
<authors>gonace</authors>
Expand Down
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,75 @@ You can download the intercom client nuget.
## Usage
> For the full documentation please read our [wiki](https://github.com/gonace/intercom/wiki)!
### Simple
> If you're using .NET (former .NET Core) and utilizing the default hosting and startup pattern (`Microsoft.Extensions.Hosting`) you use [`Intercom.Extensions.Hosting`](https://github.com/gonace/Intercom.Extensions.Hosting).
The easiest way to use the client is to run `.Configure()`, this will create a static instance (`Intercom`) of the client that can be used throughout your application.

The `Configure()` method can be initiated in two ways,
* `Intercom.Configure("baseUri", "bearerToken")`
* `Intercom.Configure("baseUri", "bearerToken", apiVersion)`

#### Examples
```c#
using Intercom.Constants;

Intercom.Configure(Url.Production, "bearerToken");
```
```c#
Intercom.Configure("baseUri", "bearerToken")
using Intercom.Constants;

Intercom.Companies...
Intercom.Me...
Intercom.Configure(Url.Production, "bearerToken", Version.Latest)
```

### Advanced
If you only need access to one (or a few) clients you're able to configure each client individually.

#### Examples
```c#
using Intercom.Constants;

public class SomeClass
{
private readonly ICompaniesClient _client;

public SomeClass()
{
_client = new CompaniesClient("baseUri", "bearerToken")
_client = new CompaniesClient(Url.Production, "bearerToken")
}
}
```

```c#

public class SomeClass
{
private readonly ICompaniesClient _client;

public SomeClass()
{
_client = new CompaniesClient(Url.Production, "bearerToken", Version.Latest)
}
}
```

### Constants
#### Url
The url constant is used to identify what production environment that will be used.

* `Production => "https://api.intercom.io/"`
* `ProductionAustralia => "https://api.au.intercom.io/"`
* `ProductionEurope => "https://api.eu.intercom.io/"`


#### Version
The version constant is used to identify what Intercom API version (Intercom-Version header) will be used, `Latest` always points to the highest available.

* `Latest`
* `Version_2_9`
* `Version_2_8`
* `Version_2_7`

## Development
### TODO

Expand Down

0 comments on commit 558ffb0

Please sign in to comment.