Skip to content

Commit

Permalink
docs: make hosted Companion more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Murderlon committed Aug 8, 2024
1 parent 9810cc8 commit 0875431
Show file tree
Hide file tree
Showing 11 changed files with 394 additions and 7 deletions.
38 changes: 38 additions & 0 deletions docs/companion.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,42 @@ files to arrive at Transloadit servers, much like Uppy.

:::

To do so each provider plugin must be configured with Transloadit’s Companion
URLs:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Dropbox from '@uppy/dropbox';

uppy.use(Dropbox, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
});
```

You may also hit rate limits, because the OAuth application is shared between
everyone using Transloadit.

To solve that, you can use your own OAuth keys with Transloadit’s hosted
Companion servers by using Transloadit Template Credentials. [Create a Template
Credential][template-credentials] on the Transloadit site. Select “Companion
OAuth” for the service, and enter the key and secret for the provider you want
to use. Then you can pass the name of the new credentials to that provider:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Dropbox from '@uppy/dropbox';

uppy.use(Dropbox, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
});
```

## Installation & use

Companion is installed from npm. Depending on how you want to run Companion, the
Expand Down Expand Up @@ -949,3 +985,5 @@ automatically restart when files are changed.
[url]: /docs/url
[zoom]: /docs/zoom
[transloadit]: https://transloadit.com
[template-credentials]:
https://transloadit.com/docs/#how-to-create-template-credentials
35 changes: 35 additions & 0 deletions docs/sources/companion-plugins/box.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,41 @@ new Uppy()
.use(Box, { companionUrl: 'https://your-companion.com' });
```

### Use with Transloadit

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Box from '@uppy/box';

uppy.use(Box, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
});
```

You may also hit rate limits, because the OAuth application is shared between
everyone using Transloadit.

To solve that, you can use your own OAuth keys with Transloadit’s hosted
Companion servers by using Transloadit Template Credentials. [Create a Template
Credential][template-credentials] on the Transloadit site. Select “Companion
OAuth” for the service, and enter the key and secret for the provider you want
to use. Then you can pass the name of the new credentials to that provider:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Box from '@uppy/box';

uppy.use(Box, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
});
```

### Use in Companion

You can create a Box App on the
Expand Down
35 changes: 35 additions & 0 deletions docs/sources/companion-plugins/dropbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,41 @@ new Uppy()
.use(Dropbox, { companionUrl: 'https://your-companion.com' });
```

### Use with Transloadit

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Dropbox from '@uppy/dropbox';

uppy.use(Dropbox, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
});
```

You may also hit rate limits, because the OAuth application is shared between
everyone using Transloadit.

To solve that, you can use your own OAuth keys with Transloadit’s hosted
Companion servers by using Transloadit Template Credentials. [Create a Template
Credential][template-credentials] on the Transloadit site. Select “Companion
OAuth” for the service, and enter the key and secret for the provider you want
to use. Then you can pass the name of the new credentials to that provider:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Dropbox from '@uppy/dropbox';

uppy.use(Dropbox, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
});
```

### Use in Companion

You can create a Dropbox App on the
Expand Down
35 changes: 35 additions & 0 deletions docs/sources/companion-plugins/facebook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,41 @@ new Uppy()
.use(Facebook, { companionUrl: 'https://your-companion.com' });
```

### Use with Transloadit

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Facebook from '@uppy/facebook';

uppy.use(Facebook, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
});
```

You may also hit rate limits, because the OAuth application is shared between
everyone using Transloadit.

To solve that, you can use your own OAuth keys with Transloadit’s hosted
Companion servers by using Transloadit Template Credentials. [Create a Template
Credential][template-credentials] on the Transloadit site. Select “Companion
OAuth” for the service, and enter the key and secret for the provider you want
to use. Then you can pass the name of the new credentials to that provider:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Facebook from '@uppy/facebook';

uppy.use(Facebook, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
});
```

### Use in Companion

You can create a Facebook App on the
Expand Down
35 changes: 35 additions & 0 deletions docs/sources/companion-plugins/google-drive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,41 @@ new Uppy()
.use(GoogleDrive, { companionUrl: 'https://your-companion.com' });
```

### Use with Transloadit

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import GoogleDrive from '@uppy/google-drive';

uppy.use(GoogleDrive, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
});
```

You may also hit rate limits, because the OAuth application is shared between
everyone using Transloadit.

To solve that, you can use your own OAuth keys with Transloadit’s hosted
Companion servers by using Transloadit Template Credentials. [Create a Template
Credential][template-credentials] on the Transloadit site. Select “Companion
OAuth” for the service, and enter the key and secret for the provider you want
to use. Then you can pass the name of the new credentials to that provider:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import GoogleDrive from '@uppy/google-drive';

uppy.use(GoogleDrive, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
});
```

### Use in Companion

To sign up for API keys, go to the
Expand Down
35 changes: 35 additions & 0 deletions docs/sources/companion-plugins/google-photos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,41 @@ new Uppy()
});
```

### Use with Transloadit

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import GooglePhotos from '@uppy/google-photos';

uppy.use(GooglePhotos, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
});
```

You may also hit rate limits, because the OAuth application is shared between
everyone using Transloadit.

To solve that, you can use your own OAuth keys with Transloadit’s hosted
Companion servers by using Transloadit Template Credentials. [Create a Template
Credential][template-credentials] on the Transloadit site. Select “Companion
OAuth” for the service, and enter the key and secret for the provider you want
to use. Then you can pass the name of the new credentials to that provider:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import GooglePhotos from '@uppy/google-photos';

uppy.use(GooglePhotos, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
});
```

### Use in Companion

To sign up for API keys, go to the
Expand Down
35 changes: 35 additions & 0 deletions docs/sources/companion-plugins/instagram.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,41 @@ new Uppy()
.use(Instagram, { companionUrl: 'https://your-companion.com' });
```

### Use with Transloadit

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Instagram from '@uppy/instagram';

uppy.use(Instagram, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
});
```

You may also hit rate limits, because the OAuth application is shared between
everyone using Transloadit.

To solve that, you can use your own OAuth keys with Transloadit’s hosted
Companion servers by using Transloadit Template Credentials. [Create a Template
Credential][template-credentials] on the Transloadit site. Select “Companion
OAuth” for the service, and enter the key and secret for the provider you want
to use. Then you can pass the name of the new credentials to that provider:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import Instagram from '@uppy/instagram';

uppy.use(Instagram, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
});
```

### Use in Companion

To sign up for API keys, go to the
Expand Down
48 changes: 41 additions & 7 deletions docs/sources/companion-plugins/onedrive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,41 @@ new Uppy()
.use(OneDrive, { companionUrl: 'https://your-companion.com' });
```

### Use with Transloadit

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import OneDrive from '@uppy/onedrive';

uppy.use(OneDrive, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
});
```

You may also hit rate limits, because the OAuth application is shared between
everyone using Transloadit.

To solve that, you can use your own OAuth keys with Transloadit’s hosted
Companion servers by using Transloadit Template Credentials. [Create a Template
Credential][template-credentials] on the Transloadit site. Select “Companion
OAuth” for the service, and enter the key and secret for the provider you want
to use. Then you can pass the name of the new credentials to that provider:

```js
import { COMPANION_URL, COMPANION_ALLOWED_HOSTS } from '@uppy/transloadit';
import OneDrive from '@uppy/onedrive';

uppy.use(OneDrive, {
companionUrl: COMPANION_URL,
companionAllowedHosts: COMPANION_ALLOWED_HOSTS,
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
});
```

### Use in Companion

To sign up for API keys, go to the
Expand All @@ -100,15 +135,14 @@ If you are using Transloadit hosted Companion:
https://api2.transloadit.com/companion/onedrive/redirect
```

Go to the “Manifest” tab, and find the `"signInAudience"` key.
Change it to `"signInAudience": "AzureADandPersonalMicrosoftAccount"`, and click
“Save”.
Go to the “Manifest” tab, and find the `"signInAudience"` key. Change it to
`"signInAudience": "AzureADandPersonalMicrosoftAccount"`, and click “Save”.

Go to the “Overview” tab.
Copy the `Application (client) ID` field - this will be your Oauth client ID.
Go to the “Overview” tab. Copy the `Application (client) ID` field - this will
be your Oauth client ID.

Go to the “Certificates & secrets” tab, and click “+ New client secret”.
Copy the `Value` field - this will be your OAuth client secret.
Go to the “Certificates & secrets” tab, and click “+ New client secret”. Copy
the `Value` field - this will be your OAuth client secret.

Configure the OneDrive key and secret in Companion. With the standalone
Companion server, specify environment variables:
Expand Down
Loading

0 comments on commit 0875431

Please sign in to comment.