Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage 1 #1

Merged
merged 25 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const { rules } = require('eslint-config-jitsi');

module.exports = {
env: {
browser: true,
jest: true,
node: true
},
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module'
},
plugins: [
'@typescript-eslint',
'eslint-plugin-import'
],
rules: {
...rules,
semi: 'off',
'no-confusing-arrow': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off'
}
}
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Web SDK CI
on: pull_request
jobs:
run-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- run: npm i
- name: Check git status
run: git status
- name: Check git diff
run: git diff
- name: Check if the git repository is clean
run: exit $( git status --porcelain --untracked-files=no | head -255 | wc -l )
- run: npm run lint
- name: Build project
run: npm run build
- name: Run unit tests
run: npm test
- name: Release to npm
if: github.event_name == 'release' && github.event.action == 'published'
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
/lib
.DS_Store
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
# jitsi-meet-web-sdk
# Jitsi Meet Web SDK
The Jitsi Meet Web SDK provides the same user experience as the [Jitsi Meet](https://github.com/jitsi/jitsi-meet) app, in a customizable way which you can embed in your apps.

## Install
```bash
npm install @jitsi/web-sdk
```
### Modules
#### fetchExternalApi
To import the Jitsi Meet External API in a non-React project:
```js
window.onload = () => {
fetchExternalApi().then(JitsiMeetExternalApi => {
const api = new JitsiMeetExternalApi("YOUR_DOMAIN");
});
}
```
#### JitsiMeeting
To be used with custom domains as-it-is in React projects:
```js
<JitsiMeeting
domain="YOUR_DOMAIN"
/>
```
#### JaaSMeeting
To be used with `8x8.vc` domain as-it-is in React projects:
```js
<JaaSMeeting
appId="YOUR_APP_ID"
/>
```

## Samples
Install and run the projects from the `examples` directory to see the modules in action.
```bash
npm run start-fetch-demo
npm run start-component-demo
```
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
presets: [
[ '@babel/preset-env' ],
'@babel/preset-react',
'@babel/preset-typescript'
],
'plugins': [ 'transform-export-extensions' ],
'only': [
'./**/*.js',
'node_modules/jest-runtime'
]
};
14 changes: 14 additions & 0 deletions examples/fetchExternalApi/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<title>Fetch External API Demo</title>
</head>

<body>
<h1 style="font-family: sans-serif; text-align: center;">External API Init Demo App</h1>
<div id="jitsi-meeting-container" />
</body>

</html>
11 changes: 11 additions & 0 deletions examples/fetchExternalApi/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { fetchExternalApi } from '@jitsi/web-sdk';

window.onload = () => {
fetchExternalApi('meet.jit.si').then(JitsiMeetExternalApi => {
const api = new JitsiMeetExternalApi('meet.jit.si', {
roomName: 'ExternalAPIInitModuleDemo',
height: 700,
parentNode: document.getElementById('jitsi-meeting-container')
});
});
};
Loading