6 | OAuth requires HTTPS, and this page is loaded via insecure HTTP. If you try to connect to Nylas like this, it will
7 | fail. To fix this problem, serve this website over HTTPS.
8 |
9 |
10 | Since this is just an example, you can disable this requirement by setting the
11 | OAUTHLIB_INSECURE_TRANSPORT environment variable to 1 before running this example again.
12 | However, you will not be able to do this when running in production.
13 |
14 |
15 | {{/insecure_override}}
16 |
17 |
Thanks for giving Nylas a try! This demo app implements Nylas authentication and allows you to create and
18 | manage scheduling pages. To get started, click this button to connect to Nylas and login to your account.
19 | Log In
20 |
21 |
--------------------------------------------------------------------------------
/python/app/templates/before_authorized.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %} {% block body %} {% if not insecure_override %}
2 |
3 |
Warning
4 |
5 | OAuth requires HTTPS, and this page is loaded via insecure HTTP. If you try to connect to Nylas like this, it will
6 | fail. To fix this problem, serve this website over HTTPS.
7 |
8 |
9 | Since this is just an example, you can disable this requirement by setting the
10 | OAUTHLIB_INSECURE_TRANSPORT environment variable to 1 before running this example again.
11 | However, you will not be able to do this when running in production.
12 |
13 |
14 | {% endif %}
15 |
16 |
Thanks for giving Nylas a try! This demo app implements Nylas authentication and allows you to create and
17 | manage scheduling pages. To get started, click this button to connect to Nylas and login to your account.
18 | Log In
19 |
20 |
26 | {% endblock %}
27 |
--------------------------------------------------------------------------------
/node/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/simple-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Nylas Scheduler Simple Example
7 |
8 |
9 |
10 |
11 |
12 |
13 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/node/src/types/fbgraph.d.ts:
--------------------------------------------------------------------------------
1 | /** Declaration file generated by dts-gen */
2 |
3 | export const version: string;
4 |
5 | export function authorize(params: any, callback: any): any;
6 |
7 | export function batch(reqs: any, additionalData: any, callback: any): any;
8 |
9 | export function del(url: any, postData: any, callback: any): any;
10 |
11 | export function extendAccessToken(params: any, callback: any): any;
12 |
13 | export function fql(query: any, params: any, callback: any): any;
14 |
15 | export function get(url: any, params?: any, callback?: any): any;
16 |
17 | export function getAccessToken(): any;
18 |
19 | export function getAppSecret(): any;
20 |
21 | export function getGraphUrl(): any;
22 |
23 | export function getOauthUrl(params: any, opts: any): any;
24 |
25 | export function getOptions(): any;
26 |
27 | export function post(url: any, postData: any, callback: any): any;
28 |
29 | export function search(options: any, callback: any): any;
30 |
31 | export function setAccessToken(token: any): any;
32 |
33 | export function setAppSecret(token: any): any;
34 |
35 | export function setGraphUrl(url: any): any;
36 |
37 | export function setOptions(options: any): any;
38 |
39 | export function setVersion(version: any): any;
40 |
41 | /**
42 | * Fairly incomplete. I only added some commonly used fields.
43 | */
44 | export type FacebookUser = {
45 | id: string,
46 | name: string,
47 | email: string,
48 | first_name: string,
49 | last_name: string,
50 | gender: string,
51 | link: string,
52 | locale: string,
53 | timezone: number
54 | };
55 |
56 |
--------------------------------------------------------------------------------
/node/src/app.ts:
--------------------------------------------------------------------------------
1 | import express from "express";
2 | import flash from "express-flash";
3 | import session from "express-session";
4 | import bodyParser from "body-parser";
5 | import compression from "compression"; // compresses requests
6 | import consolidate from "consolidate";
7 | import lusca from "lusca";
8 | import path from "path";
9 | import Nylas from "nylas";
10 |
11 | // Controllers (route handlers)
12 | import router from "./controllers/base";
13 |
14 | const NylasClientID = process.env["NYLAS_OAUTH_CLIENT_ID"];
15 | const NylasClientSecret = process.env["NYLAS_OAUTH_CLIENT_SECRET"];
16 |
17 | if (!NylasClientID || !NylasClientSecret) {
18 | console.warn(`
19 | To run this example, pass the NYLAS_OAUTH_CLIENT_ID and NYLAS_OAUTH_CLIENT_SECRET
20 | environment variables when launching the service. eg:\n
21 | REDIRECT_URI=https://ad172180.ngrok.io/login_callback NYLAS_OAUTH_CLIENT_ID=XXX NYLAS_OAUTH_CLIENT_SECRET=XXX npm start
22 | `);
23 | process.exit(1);
24 | }
25 |
26 | // Configure Nylas
27 | Nylas.config({
28 | appId: NylasClientID,
29 | appSecret: NylasClientSecret
30 | });
31 |
32 | // Create Express server
33 | const app = express();
34 |
35 | // assign the mustache enging to .mustache files
36 | app.engine("mustache", consolidate.mustache);
37 |
38 | // Express configuration
39 | app.set("port", process.env["PORT"] || 5000);
40 | app.set("views", path.join(__dirname, "../views"));
41 | app.set("view engine", "mustache");
42 | app.use(compression());
43 | app.use(bodyParser.json());
44 | app.use(bodyParser.urlencoded({ extended: true }));
45 | app.use(
46 | session({
47 | resave: true,
48 | saveUninitialized: true,
49 | secret: process.env["SECRET_KEY"] || "test-secret",
50 | cookie: { maxAge: 60000 }
51 | })
52 | );
53 | app.use(flash());
54 | app.use(lusca.xframe("SAMEORIGIN"));
55 | app.use(lusca.xssProtection(true));
56 |
57 | app.use(
58 | express.static(path.join(__dirname, "public"), { maxAge: 31557600000 })
59 | );
60 |
61 | app.use(router);
62 |
63 | export default app;
64 |
--------------------------------------------------------------------------------
/node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nylas-scheduling-example-nodejs",
3 | "version": "0.1.0",
4 | "description": "A starting point for Node.js express apps with TypeScript",
5 | "repository": {
6 | "type": "git",
7 | "url": "https://github.com/Nylas/Nylas-Scheduling-Beta"
8 | },
9 | "author": "",
10 | "license": "MIT",
11 | "scripts": {
12 | "start": "npm run build && npm run serve",
13 | "build": "tsc",
14 | "serve": "node dist/server.js",
15 | "test": "jest --forceExit --coverage --verbose"
16 | },
17 | "dependencies": {
18 | "async": "^3.0.1",
19 | "bcrypt-nodejs": "^0.0.3",
20 | "bluebird": "^3.5.5",
21 | "body-parser": "^1.19.0",
22 | "compression": "^1.7.4",
23 | "consolidate": "^0.15.1",
24 | "dotenv": "^8.0.0",
25 | "errorhandler": "^1.5.1",
26 | "express": "^4.17.1",
27 | "express-flash": "0.0.2",
28 | "express-session": "^1.16.2",
29 | "express-validator": "^6.0.1",
30 | "lodash": "^4.17.19",
31 | "lusca": "^1.6.1",
32 | "mustache": "^3.0.1",
33 | "nodemailer": "^6.2.1",
34 | "nylas": "^4.6.1",
35 | "request": "^2.88.0",
36 | "request-promise": "^4.2.4",
37 | "winston": "^2.4.2"
38 | },
39 | "devDependencies": {
40 | "@types/async": "^3.0.0",
41 | "@types/bcrypt-nodejs": "^0.0.30",
42 | "@types/bluebird": "^3.5.27",
43 | "@types/body-parser": "^1.17.0",
44 | "@types/compression": "^0.0.36",
45 | "@types/consolidate": "^0.14.0",
46 | "@types/dotenv": "^6.1.1",
47 | "@types/errorhandler": "^0.0.32",
48 | "@types/express": "^4.17.0",
49 | "@types/express-session": "^1.15.13",
50 | "@types/jest": "^24.0.15",
51 | "@types/jquery": "^3.3.29",
52 | "@types/lodash": "^4.14.134",
53 | "@types/lusca": "^1.6.0",
54 | "@types/morgan": "^1.7.35",
55 | "@types/node": "^12.0.10",
56 | "@types/nodemailer": "^6.2.0",
57 | "@types/request": "^2.48.1",
58 | "@types/request-promise": "^4.1.44",
59 | "@types/shelljs": "^0.8.5",
60 | "@types/supertest": "^2.0.7",
61 | "@types/winston": "^2.3.9",
62 | "chai": "^4.2.0",
63 | "concurrently": "^4.1.0",
64 | "jest": "^24.8.0",
65 | "shelljs": "^0.8.3",
66 | "supertest": "^4.0.2",
67 | "ts-jest": "^24.0.2",
68 | "ts-node": "^8.3.0",
69 | "typescript": "^3.5.3"
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/node/src/controllers/base.ts:
--------------------------------------------------------------------------------
1 | import express, { Request, Response } from "express";
2 | import request from "request-promise";
3 | import Nylas from "nylas";
4 |
5 | const redirectURI = process.env.REDIRECT_URI ||
6 | "https://nylas-customer-example-nodejs.herokuapp.com/login_callback";
7 |
8 | const router = express.Router();
9 |
10 | router.get("/", async (req: Request, res: Response) => {
11 | const accessToken = req.session["access_token"];
12 | if (!accessToken) {
13 | res.render("base", {
14 | login_href: Nylas.urlForAuthentication({
15 | redirectURI,
16 | scopes: ["calendar"]
17 | }),
18 | insecure_override: req.protocol !== "https",
19 | partials: { authorization_partial: "partials/before_authorized" }
20 | });
21 | return;
22 | }
23 |
24 | const nylas = Nylas.with(accessToken);
25 | const account = await nylas.account.get();
26 |
27 | // If the user has already connected to Nylas via OAuth,
28 | // `nylas.authorized` will be true. Otherwise, it will be false.
29 | const pages = await request.get({
30 | uri: "https://schedule.api.nylas.com/manage/pages",
31 | headers: { Authorization: `Bearer ${accessToken}` },
32 | json: true
33 | });
34 |
35 | res.render("base", {
36 | pages,
37 | account,
38 | accessToken,
39 | partials: { authorization_partial: "partials/after_authorized" }
40 | });
41 | });
42 |
43 | router.post("/", async (req: Request, res: Response) => {
44 | const accessToken = req.session["access_token"];
45 | if (!accessToken) {
46 | res.redirect("/");
47 | return;
48 | }
49 |
50 | const newPage = await request.post({
51 | uri: "https://schedule.api.nylas.com/manage/pages",
52 | json: true,
53 | body: {
54 | name: req.body["name"],
55 | slug: req.body["slug"],
56 | access_tokens: [accessToken],
57 | config: {
58 | // You can provide as few or as many page configuration options as you like.
59 | // Check out the Scheduling Page documentation for a full list of settings.
60 | event: {
61 | title: req.body["event_title"]
62 | }
63 | }
64 | }
65 | });
66 |
67 | res.redirect("/");
68 | });
69 |
70 | router.get("/login_callback", async (req: Request, res: Response) => {
71 | if (req.query.error) {
72 | res.status(400).send(`Login error: ${req.query["error"]}`);
73 | return;
74 | }
75 |
76 | const token = await Nylas.exchangeCodeForToken(req.query.code);
77 |
78 | // save the token to the current session, save it to the user model, etc.
79 | req.session["access_token"] = token;
80 |
81 | res.redirect("/");
82 | });
83 |
84 | export default router;
85 |
--------------------------------------------------------------------------------
/node/README.md:
--------------------------------------------------------------------------------
1 | # Example: Hosted OAuth + Scheduling
2 |
3 | This is an example project that implements login via [Nylas Hosted OAuth flow](https://docs.nylas.com/reference#oauth) and demonstrates both instant and smart integration types with the Nylas Scheduler.
4 |
5 | This example uses the [Express](https://expressjs.com/) web framework for NodeJS and is written in TypeScript. In order to successfully run this example and go through the Nylas OAuth flow, you need to follow the steps below.
6 |
7 |
8 | ## Get an Application Client ID & Client Secret from Nylas
9 |
10 | To do this, login (or create) your Nylas developer account using the [Nylas Dashboard](https://dashboard.nylas.com/) account. You should see your `client_id` and `client_secret` on the dashboard.
11 |
12 | ## Set Up HTTPS
13 |
14 | The OAuth protocol requires that all communication occur via the secure HTTPS connections, rather than insecure HTTP connections. You can deploy the application to a serivce like Heroku to test it, or configure HTTPS on your computer. Perhaps the simplest is to use [ngrok](https://ngrok.com), a tool that lets you create a secure tunnel from the ngrok website to your computer. Install it from the website, and then run the following command:
15 |
16 | ```
17 | ngrok http 5000
18 | ```
19 |
20 | Notice that ngrok will show you two "forwarding" URLs, which may look something like `http://ed90abe7.ngrok.io` and `https://ed90abe7.ngrok.io`. (The hash subdomain will be different for you.) You'll be using the second URL, which starts with `https`.
21 |
22 | ## Set the Nylas Callback URL
23 |
24 | Once you have a HTTPS URL that points to your computer, you'll need to tell Nylas about it. On the [Nylas Dashboard](https://dashboard.nylas.com) click on the Application Dropdown Menu on the left, then "View all Applications". From there, select "Edit" for the app you'd like to use and select the "Application Callbacks" tab. Paste your HTTPS URL into the text field, and add `/login_callback` after it. For example, if your HTTPS URL is `https://ad172180.ngrok.io`, then you would put `https://ad172180.ngrok.io/login_callback` into the text field in the "Application Callbacks" tab.
25 |
26 | Then click the "Add Callback" button to save.
27 |
28 | ## Install the Dependencies
29 |
30 | This project depends on a few third-party Node modules, like `express` and `requests`. These dependencies are listed in the `package.json` file in this directory.
31 |
32 | ```
33 | npm install
34 | ```
35 |
36 | ## Run the Example
37 |
38 | Finally, run the example project like this, specifying the redirect URL you configured along with your Nylas client ID and secret as environment variables:
39 |
40 | ```
41 | REDIRECT_URI=https://ad172180.ngrok.io/login_callback NYLAS_OAUTH_CLIENT_ID=XXX NYLAS_OAUTH_CLIENT_SECRET=XXX npm start
42 | ```
43 |
44 | Once the server is running, visit the ngrok URL in your browser to test it out!
45 |
46 |
47 | ## Troubleshooting
48 |
49 | * For OAuth to succeed, you need to visit the Ngrok URL in your browser, not localhost.
50 | * For OAuth to succeed, you need to pass the Ngrok redirect URL with the "/login_callback" path to the app as an environment variable.
51 |
--------------------------------------------------------------------------------
/python/README.md:
--------------------------------------------------------------------------------
1 | # Example: Hosted OAuth + Scheduling
2 |
3 | This is an example project that implements login via [Nylas Hosted OAuth flow](https://docs.nylas.com/reference#oauth) and demonstrates both instant and smart integration types with the Nylas Scheduler.
4 |
5 | Try it out now! Visit [http://nylas-customer-example.herokuapp.com/](http://nylas-customer-example.herokuapp.com/).
6 |
7 | This example uses the [Flask](http://flask.pocoo.org/) web framework for Python. In order to successfully run this example and go through the Nylas OAuth flow, you need to follow the steps below.
8 |
9 |
10 | ## Get an Application Client ID & Client Secret from Nylas
11 |
12 | To do this, login (or create) your Nylas developer account using the [Nylas Dashboard](https://dashboard.nylas.com/) account. You should see your `client_id` and `client_secret` on the dashboard.
13 |
14 | ## Update the `config.json` File
15 |
16 | Open the `config.json` file in this directory, and replace the example `client_id` and `client_secret` with the real values that you got from the Nylas Developer dashboard. You'll also need to replace the example secret key with any random string of letters and numbers: a keyboard mash will do.
17 |
18 | ## Set Up HTTPS
19 |
20 | The OAuth protocol requires that all communication occur via the secure HTTPS connections, rather than insecure HTTP connections. There are several ways to set up HTTPS on your computer, but perhaps the simplest is to use
21 | [ngrok](https://ngrok.com), a tool that lets you create a secure tunnel from the ngrok website to your computer. Install it from the website, and then run the following command:
22 |
23 | ```
24 | ngrok http 5000
25 | ```
26 |
27 | Notice that ngrok will show you two "forwarding" URLs, which may look something like `http://ed90abe7.ngrok.io` and `https://ed90abe7.ngrok.io`. (The hash subdomain will be different for you.) You'll be using the second URL, which starts with `https`.
28 |
29 | Alternatively, you can set the `OAUTHLIB_INSECURE_TRANSPORT` environment variable in your shell, to disable the HTTPS check. That way, you'll be able to use `localhost` to refer to your app, instead of an ngrok URL. However, be aware that you won't be able to do this when you deploy your app to production, so it's usually a better idea to set up HTTPS properly.
30 |
31 | ## Set the Nylas Callback URL
32 |
33 | Once you have a HTTPS URL that points to your computer, you'll need to tell Nylas about it. On the [Nylas Dashboard](https://dashboard.nylas.com) click on the Application Dropdown Menu on the left, then "View all Applications". From there, select "Edit" for the app you'd like to use and select the "Application Callbacks" tab. Paste your HTTPS URL into the text field, and add `/login/nylas/authorized` after it. For example, if your HTTPS URL is `https://ad172180.ngrok.io`, then you would put `https://ad172180.ngrok.io/login/nylas/authorized` into the text field in the "Application Callbacks" tab.
34 |
35 | Then click the "Add Callback" button to save.
36 |
37 | ## Install the Dependencies
38 |
39 | This project depends on a few third-party Python modules, like Flask. These dependencies are listed in the `requirements.txt` file in this directory. To get started, install [pipenv](https://pypi.org/project/pipenv/) and run the command below to setup your python virtualenv for the example app:
40 |
41 | ```
42 | pipenv install
43 | ```
44 |
45 | ## Run the Example
46 |
47 | Finally, run the example project like this:
48 |
49 | ```
50 | pipenv run flask run
51 | ```
52 |
53 | Once the server is running, visit the ngrok URL in your browser to test it out!
54 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 |
25 | # nyc test coverage
26 | .nyc_output
27 |
28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29 | .grunt
30 |
31 | # Bower dependency directory (https://bower.io/)
32 | bower_components
33 |
34 | # node-waf configuration
35 | .lock-wscript
36 |
37 | # Compiled binary addons (https://nodejs.org/api/addons.html)
38 | build/Release
39 |
40 | # Dependency directories
41 | node_modules/
42 | jspm_packages/
43 |
44 | # TypeScript v1 declaration files
45 | typings/
46 |
47 | # TypeScript cache
48 | *.tsbuildinfo
49 |
50 | # Optional npm cache directory
51 | .npm
52 |
53 | # Optional eslint cache
54 | .eslintcache
55 |
56 | # Microbundle cache
57 | .rpt2_cache/
58 | .rts2_cache_cjs/
59 | .rts2_cache_es/
60 | .rts2_cache_umd/
61 |
62 | # Optional REPL history
63 | .node_repl_history
64 |
65 | # Output of 'npm pack'
66 | *.tgz
67 |
68 | # Yarn Integrity file
69 | .yarn-integrity
70 |
71 | # dotenv environment variables file
72 | .env
73 | .env.test
74 |
75 | # parcel-bundler cache (https://parceljs.org/)
76 | .cache
77 |
78 | # next.js build output
79 | .next
80 |
81 | # nuxt.js build output
82 | .nuxt
83 |
84 | # gatsby files
85 | .cache/
86 | public
87 |
88 | # vuepress build output
89 | .vuepress/dist
90 |
91 | # Serverless directories
92 | .serverless/
93 |
94 | # FuseBox cache
95 | .fusebox/
96 |
97 | # DynamoDB Local files
98 | .dynamodb/
99 |
100 |
101 | # Byte-compiled / optimized / DLL files
102 | __pycache__/
103 | *.py[cod]
104 | *$py.class
105 |
106 | # C extensions
107 | *.so
108 |
109 | # Distribution / packaging
110 | .Python
111 | build/
112 | develop-eggs/
113 | dist/
114 | downloads/
115 | eggs/
116 | .eggs/
117 | lib/
118 | lib64/
119 | parts/
120 | sdist/
121 | var/
122 | wheels/
123 | pip-wheel-metadata/
124 | share/python-wheels/
125 | *.egg-info/
126 | .installed.cfg
127 | *.egg
128 | MANIFEST
129 |
130 | # PyInstaller
131 | # Usually these files are written by a python script from a template
132 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
133 | *.manifest
134 | *.spec
135 |
136 | # Installer logs
137 | pip-log.txt
138 | pip-delete-this-directory.txt
139 |
140 | # Unit test / coverage reports
141 | htmlcov/
142 | .tox/
143 | .nox/
144 | .coverage
145 | .coverage.*
146 | .cache
147 | nosetests.xml
148 | coverage.xml
149 | *.cover
150 | *.py,cover
151 | .hypothesis/
152 | .pytest_cache/
153 |
154 | # Translations
155 | *.mo
156 | *.pot
157 |
158 | # Django stuff:
159 | *.log
160 | local_settings.py
161 | db.sqlite3
162 | db.sqlite3-journal
163 |
164 | # Flask stuff:
165 | instance/
166 | .webassets-cache
167 |
168 | # Scrapy stuff:
169 | .scrapy
170 |
171 | # Sphinx documentation
172 | docs/_build/
173 |
174 | # PyBuilder
175 | target/
176 |
177 | # Jupyter Notebook
178 | .ipynb_checkpoints
179 |
180 | # IPython
181 | profile_default/
182 | ipython_config.py
183 |
184 | # pyenv
185 | .python-version
186 |
187 | # pipenv
188 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
189 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
190 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
191 | # install all needed dependencies.
192 | #Pipfile.lock
193 |
194 | # celery beat schedule file
195 | celerybeat-schedule
196 |
197 | # SageMath parsed files
198 | *.sage.py
199 |
200 | # Environments
201 | .env
202 | .venv
203 | env/
204 | venv/
205 | ENV/
206 | env.bak/
207 | venv.bak/
208 |
209 | # Spyder project settings
210 | .spyderproject
211 | .spyproject
212 |
213 | # Rope project settings
214 | .ropeproject
215 |
216 | # mkdocs documentation
217 | /site
218 |
219 | # mypy
220 | .mypy_cache/
221 | .dmypy.json
222 | dmypy.json
223 |
224 | # Pyre type checker
225 | .pyre/
226 | .DS_Store
227 |
--------------------------------------------------------------------------------
/node/views/partials/after_authorized.mustache:
--------------------------------------------------------------------------------
1 |
2 | Signed in as {{ account.name }} ({{account.emailAddress}}).
3 |
33 | The easiest way to integrate scheduling pages into your app is to use the
34 | instant schedule integration type and pass the user's Nylas access_token.
35 | When provided a Nylas access_token, the scheduling widget shows all pages that
36 | use that token.
37 |
38 |
39 |
61 |
62 |
63 |
64 |
Server-side Integration
65 |
66 | This approach allows you to restrict the ability of users to create arbitrary scheduling pages
67 | and also allows for scheduling pages that use more than one Nylas API token. It does not require
68 | putting the Nylas API token in the client-side JavaScript.
69 |
70 | This flow is split into two parts:
71 |
72 |
73 | Create a scheduling page via an API call to schedule.api.nylas.com.
74 |
75 |
76 | Show scheduling pages to the user by retrieving the pages that include the user's
77 | Nylas API token on the fly. If only certain users should have permission to view or edit pages,
78 | you might want to filter the list that is returned using data in your application.
79 |
80 |
81 | Present the built-in configuration modal for individual pages using their edit tokens.
82 | (Optional! You could also build your own editing interface or not allow users to customize the pages.)
83 |
35 | The easiest way to integrate scheduling pages into your app is to use the built-in management
36 | UI and pass the user's Nylas API token. When provided a Nylas API token, the scheduling widget
37 | shows all pages that use the token.
38 |
39 |
40 |
62 |
63 |
64 |
65 |
Server-side Integration
66 |
67 | This approach allows you to restrict the ability of users to create arbitrary scheduling pages
68 | and also allows for scheduling pages that use more than one Nylas API token. It does not require
69 | putting the Nylas API token in the client-side JavaScript.
70 |
71 | This flow is split into two parts:
72 |
73 |
74 | Create a scheduling page via an API call to schedule.api.nylas.com.
75 |
76 |
77 | Show scheduling pages to the user by retrieving the pages that include the user's
78 | Nylas API token on the fly. If only certain users should have permission to view or edit pages,
79 | you might want to filter the list that is returned using data in your application.
80 |
81 |
82 | Present the built-in configuration modal for individual pages using their edit tokens.
83 | (Optional! You could also build your own editing interface or not allow users to customize the pages.)
84 |