Skip to content

Commit f43b575

Browse files
authored
feat: support multiple brands (#470)
* feat: support multiple brands * feat: multiple brands style * chore: add docs * update README * update docs * fix README
1 parent c639b35 commit f43b575

27 files changed

+593
-114
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
API_KEY: ${{ secrets.API_KEY }}
4949
API_SERVER: ${{ secrets.API_SERVER }}
5050
HOSTING_URL: ${{ secrets.HOSTING_URL }}
51+
- run: ./build_brand_themes.sh
5152
- name: Github Pages
5253
uses: JamesIves/[email protected]
5354
with:
@@ -76,6 +77,7 @@ jobs:
7677
env:
7778
API_KEY: ${{ secrets.API_KEY }}
7879
API_SERVER: ${{ secrets.API_SERVER }}
80+
- run: ./build_brand_themes.sh
7981
- name: Github Pages
8082
uses: JamesIves/[email protected]
8183
with:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ To get all versions of RingCentral Embeddable in [here](https://github.com/ringc
6464
* [Use your own app client id](docs/config-client-id-and-secret.md)
6565
* [Customize Redirect Uri](docs/customize-redirect-uri.md)
6666
* [Enable Multiple Tabs Support](docs/multiple-tabs.md)
67+
* [Multiple Partner Brands Support](docs/multiple-brands.md)
6768
* [Customize prefix](docs/customize-prefix.md)
6869
* [Work with the Web Widget event](docs/widget-event.md)
6970
* [Web phone call event](docs/widget-event.md#web-phone-call-event)

build_brand_themes.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
# TODO: compile multiple themes in Webpack after mini-css-extract-plugin support https://github.com/webpack-contrib/mini-css-extract-plugin/issues/427
4+
5+
BRAND=att DISABLE_MINIMIZE=1 yarn build
6+
cp release/att/app.css release/app.att.css
7+
rm -rf release/att
8+
9+
BRAND=bt DISABLE_MINIMIZE=1 yarn build
10+
cp release/bt/app.css release/app.bt.css
11+
rm -rf release/bt
12+
13+
BRAND=telus DISABLE_MINIMIZE=1 yarn build
14+
cp release/telus/app.css release/app.telus.css
15+
rm -rf release/telus

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RingCentral Embeddable is an out-of-the-box embeddable web application built usi
1010
* [Customize Redirect Uri](customize-redirect-uri.md)
1111
* [Customize prefix](customize-prefix.md)
1212
* [Enable Multiple Tabs](multiple-tabs.md)
13+
* [Multiple Partner Brand Support](multiple-brands.md)
1314
* [Work with the web widget event](widget-event.md)
1415
* [Web phone call event](widget-event.md#web-phone-call-event)
1516
* [Active Call event](widget-event.md#active-call-event)

docs/get-started.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ Create a iframe with the following code:
2828

2929
#### Stable version
3030

31-
We provide latest RingCentral Embeddable version on github page `https://ringcentral.github.io/ringcentral-embeddable`. It includes latest features and bugfix in RingCentral Embeddable. And it will keep up to date with master code. But we **recommend** developers to use versioned RingCentral Embeddable. Current latest stable version of RingCentral Embeddable is `1.0.1`. You can get `1.0.1` app in this uri `https://apps.ringcentral.com/integration/ringcentral-embeddable/1.0.1`.
31+
We provide latest RingCentral Embeddable version on github page `https://ringcentral.github.io/ringcentral-embeddable`. It includes latest features and bugfix in RingCentral Embeddable. And it will keep up to date with master code. But we **recommend** developers to use versioned RingCentral Embeddable. You can get current latest stable version of RingCentral Embeddable from [here](https://github.com/ringcentral/ringcentral-embeddable/releases). Such as `1.4.1`, you can get versioned app in this uri `https://apps.ringcentral.com/integration/ringcentral-embeddable/1.4.1`.
3232

33-
Just replace `https://ringcentral.github.io/ringcentral-embeddable` in docs to the versioned uri, and you will be using versioned RingCentral Embeddable. The versioned app will not be influenced when new features are added, so it will be more stable than latest version. When you need to update RingCentral Embeddable, you need to update the versioned app uri in your code manually.
33+
Just replace `https://ringcentral.github.io/ringcentral-embeddable` in [upper code](#adapter-js-way) to the versioned uri, and you will be using versioned RingCentral Embeddable. The versioned app will not be influenced when new features are added, so it will be more stable than latest version. When you need to update RingCentral Embeddable, you need to update the versioned app uri in your code manually.
3434

35-
For stable version from `1.0.2`, it is required to setup your own RingCentral client id. Please follow [here](config-client-id-and-secret.md) to setup.
35+
For stable version from `1.0.2`, it is required to setup your own RingCentral client id. Please follow [here](docs/config-client-id-and-secret.md) to setup, or it will throw error with client id required.
36+
For stable version from `1.2.0`, authorization redirect uri will change with version as `https://apps.ringcentral.com/integration/ringcentral-embeddable/1.4.1/redirect.html`, but you can make a fixed redirect URI with this [docs](docs/customize-redirect-uri.md).
3637

3738
To get all versions of RingCentral Embeddable in [here](https://github.com/ringcentral/ringcentral-embeddable/releases).
3839

@@ -42,7 +43,7 @@ Example scripts with versioned app:
4243
<script>
4344
(function() {
4445
var rcs = document.createElement("script");
45-
rcs.src = "https://apps.ringcentral.com/integration/ringcentral-embeddable/0.1.0/adapter.js";
46+
rcs.src = "https://apps.ringcentral.com/integration/ringcentral-embeddable/1.4.1/adapter.js";
4647
var rcs0 = document.getElementsByTagName("script")[0];
4748
rcs0.parentNode.insertBefore(rcs, rcs0);
4849
})();

docs/multiple-brands.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Multiple Brands
2+
3+
RingCentral works with a number of [carriers and partners](https://developers.ringcentral.com/guide/basics/partner-compatibility) to deliver a cutting edge white labeled Cloud Communications service directly to their respective customers. This guide will show you how to create RingCentral Embeddable app for other brands.
4+
5+
## AT&T Office@Hand
6+
7+
### Adapter JS way
8+
9+
* Use `adapter.att.js` to instead of `adapter.js`
10+
* Set `appServer` to `https://platform.ringcentral.biz`
11+
12+
```js
13+
<script>
14+
(function() {
15+
var rcs = document.createElement("script");
16+
rcs.src = "https://ringcentral.github.io/ringcentral-embeddable/adapter.att.js?appServer=https://platform.ringcentral.biz";
17+
var rcs0 = document.getElementsByTagName("script")[0];
18+
rcs0.parentNode.insertBefore(rcs, rcs0);
19+
})();
20+
</script>
21+
```
22+
23+
### Iframe way
24+
25+
Add `brand=att` and `appServer` in src query parameter:
26+
27+
```html
28+
<iframe width="300" height="500" id="rc-widget" allow="microphone" src="https://ringcentral.github.io/ringcentral-embeddable/app.html?brand=att&appServer=https://platform.ringcentral.biz">
29+
</iframe>
30+
```
31+
32+
## BT Cloud Work
33+
34+
Use `adapter.bt.js` to instead of `adapter.js`:
35+
36+
```js
37+
<script>
38+
(function() {
39+
var rcs = document.createElement("script");
40+
rcs.src = "https://ringcentral.github.io/ringcentral-embeddable/adapter.bt.js";
41+
var rcs0 = document.getElementsByTagName("script")[0];
42+
rcs0.parentNode.insertBefore(rcs, rcs0);
43+
})();
44+
</script>
45+
```
46+
47+
### Iframe way
48+
49+
Add `brand=bt` in src query parameter:
50+
51+
```html
52+
<iframe width="300" height="500" id="rc-widget" allow="microphone" src="https://ringcentral.github.io/ringcentral-embeddable/app.html?brand=bt">
53+
</iframe>
54+
```
55+
56+
## TELUS
57+
58+
Use `adapter.telus.js` to instead of `adapter.js`:
59+
60+
```js
61+
<script>
62+
(function() {
63+
var rcs = document.createElement("script");
64+
rcs.src = "https://ringcentral.github.io/ringcentral-embeddable/adapter.telus.js";
65+
var rcs0 = document.getElementsByTagName("script")[0];
66+
rcs0.parentNode.insertBefore(rcs, rcs0);
67+
})();
68+
</script>
69+
```
70+
71+
### Iframe way
72+
73+
Add `brand=telus` in src query parameter:
74+
75+
```html
76+
<iframe width="300" height="500" id="rc-widget" allow="microphone" src="https://ringcentral.github.io/ringcentral-embeddable/app.html?brand=telus">
77+
</iframe>
78+
```
79+
80+
## Other Brands
81+
82+
For other brands, we are still customizing styles for them. Those users can use with default brand.
83+
84+
### Adapter JS way
85+
86+
```js
87+
<script>
88+
(function() {
89+
var rcs = document.createElement("script");
90+
rcs.src = "https://ringcentral.github.io/ringcentral-embeddable/adapter.js";
91+
var rcs0 = document.getElementsByTagName("script")[0];
92+
rcs0.parentNode.insertBefore(rcs, rcs0);
93+
})();
94+
</script>
95+
```
96+
97+
### Iframe way
98+
99+
```html
100+
<iframe width="300" height="500" id="rc-widget" allow="microphone" src="https://ringcentral.github.io/ringcentral-embeddable/app.html">
101+
</iframe>
102+
```

getBrandConfig/att/icon.svg

Lines changed: 19 additions & 0 deletions
Loading

getBrandConfig/att/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
prefix: 'rc-widget',
3+
brandConfig: {
4+
id: '3420',
5+
brandCode: 'att',
6+
code: 'att',
7+
name: 'Office@Hand',
8+
appName: 'Office@Hand Embeddable',
9+
fullName: 'Office@Hand',
10+
application: 'Office@Hand Embeddable',
11+
teleconference: 'https://meetings-officeathand.att.com/teleconference',
12+
},
13+
brandFolder: __dirname,
14+
};

0 commit comments

Comments
 (0)