|
1 | | - |
2 | | -# :tada: This project is maintained again! - [and needs your input](https://github.com/NangoHQ/Pizzly/issues/263) :tada: |
3 | | -Hello fellow Pizzly users! |
4 | | - |
5 | | -We are Nango, a young team working on [open-source tools](https://github.com/NangoHQ/nango) to make working with 3rd party APIs fast & simple for engineers. |
6 | | -We just took over Pizzly from the original authors, the [bearer team](https://www.bearer.com/?ref=pizzly) and are very much looking forward to giving it a new life and roadmap! |
7 | | - |
8 | | -Here is our current plan: |
9 | | -- Short term (next 1-2 weeks) we are focused on getting Pizzly running again (see next section) |
10 | | -- Beyond that we are looking to make it better. For this we need your input here: https://github.com/NangoHQ/Pizzly/issues/263 |
11 | | - |
12 | | -Meanwhile, if you want to get involved or talk with us please join our [Slack community](https://nango.dev/slack) where we are very active. |
13 | | - |
14 | | -BIG THANKS to the Bearer team and all the contributors for their hard work! 🐻 👏 |
15 | | -Pizzly has gained a strong following because it is one of the fastest and simplest ways to work with APIs that use OAuth. We look forward to continue this mission together with the community :) |
16 | | - |
17 | | -## Current state of Pizzly (last update: 16th Nov 2022) |
18 | | -Pizzly currently does not run locally with the latest stable version of node (18.x) |
19 | | - |
20 | | -The 1-click Heroku deployment button still works, but means you will need to pay for the deployment starting November 28th when Heroku expires its free tier. |
21 | | - |
22 | | -Fixing Pizzly is our first priority. If you need help with your instance in the meantime please open an issue or reach out to us on the [Slack community](https://nango.dev/slack). We will do our best to help. |
23 | | - |
24 | | ---- |
25 | | - |
26 | | -<a href="https://heroku.com/deploy?template=https://github.com/Bearer/Pizzly" rel="nofollow"><img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" height="26"></a> |
27 | | -<a href="https://console.platform.sh/projects/create-project/?template=https://github.com/Bearer/Pizzly&utm_campaign=deploy_on_platform?utm_medium=button&utm_source=affiliate_links&utm_content=https://github.com/Bearer/Pizzly" rel="nofollow"><img src="https://platform.sh/images/deploy/deploy-button-lg-blue.svg" alt="Deploy with Platform.sh" height="26"></a> |
28 | | -<a href="https://www.bearer.com/?ref=pizzly"><img src="/views/assets/img/badges/bearer-badge.png?raw=true" alt="The #1 data security as code platform" height="26"></a> |
29 | | - |
30 | | -# Pizzly 🐻 - The OAuth Integration Proxy |
| 1 | +```diff |
| 2 | ++ Using Pizzly v0.2.x? Please read this about migrating to v0.3+: https://docs.nango.dev/pizzly/migration + |
| 3 | +``` |
31 | 4 |
|
32 | 5 | <div align="center"> |
33 | | - |
34 | | -<img src="/views/assets/img/logos/pizzly.png?raw=true" width="300"> |
35 | | - |
36 | | -[How it works?](#how-it-works) - [Getting started](#getting-started) - [Documentation](#documentation) |
37 | | -[Examples](#examples) - [Supported APIs](#supported-apis) - [Contributing](#contributing) |
| 6 | + |
| 7 | +<img src="/assets/pizzly-logo.png?raw=true" width="350"> |
38 | 8 |
|
39 | 9 | </div> |
40 | 10 |
|
41 | | -**Pizzly makes it fast and reliable to build API integrations**. It handles dozens of pre-configured APIs (including Salesforce, Slack, Google Sheets [and many more](#supported-apis)) and lets you quickly add more APIs with a generic JSON configuration schema. |
| 11 | +<h1 align="center">The fast & flexible way to get OAuth tokens for 50+ APIs</h1> |
42 | 12 |
|
43 | | -Using Pizzly your engineering team can focus on consuming APIs, in a standardized way that will grow as you grow. |
| 13 | +<div align="center"> |
| 14 | +Pizzly takes care of the OAuth dance for you and makes sure your access tokens always stay fresh. |
| 15 | +</div> |
44 | 16 |
|
45 | | -## How it works? |
| 17 | +<p align="center"> |
| 18 | + <br /> |
| 19 | + <a href="https://docs.nango.dev" rel="dofollow"><strong>Explore the docs »</strong></a> |
| 20 | + <br /> |
46 | 21 |
|
47 | | -At the heart of Pizzly is a Node.js application that uses PostgreSQL as a database. Once deployed on your servers, each instance of Pizzly provides multiple tools to help developers with their API integrations, including: |
| 22 | + <br/> |
| 23 | + <a href="https://docs.nango.dev/">All supported APIs</a> |
| 24 | + · |
| 25 | + <a href="https://github.com/nangohq/nango/issues">Contribute an API</a> |
| 26 | + · |
| 27 | + <a href="https://github.com/nangohq/nango/issues">Report Bug</a> |
| 28 | + · |
| 29 | + <a href="https://nango.dev/slack">Community Slack</a> |
| 30 | +</p> |
48 | 31 |
|
49 | | -- **a dashboard** - _to enable and configure APIs_; |
50 | | -- **an auth service** - _to handle the OAuth-dance_; |
51 | | -- **a proxy** - _to perform authenticated requests to an API_; |
52 | | -- a JS library - _to connect a user and perform requests from your frontend_; |
53 | | -- and its own API - _to programmatically do what you can do with the dashboard_. |
| 32 | +## ⭐ Pizzly at a glance |
54 | 33 |
|
55 | | -[](https://demopizzly.herokuapp.com/dashboard/all) |
| 34 | +Pizzly is a small, self-contained service (docker container) that contains everything you need to work with APIs that use OAuth. |
56 | 35 |
|
57 | | -## Getting started |
| 36 | +Pizzly has been designed for modern web apps/backends and contains: |
58 | 37 |
|
59 | | -Pizzly can be installed anywhere (AWS, Heroku, Platform.sh, etc.). Here's a quick guide: |
| 38 | +- a full OAuth 2 and OAuth 1.0a dance implementation for 50+ APIs (and more coming) |
| 39 | +- a frontend SDK that makes it easy to trigger new OAuth flows from your web app |
| 40 | +- a backend SDK & REST API that make it easy to get always-fresh access tokens for your API calls |
| 41 | +- a CLI that makes it easy to manage your OAuth provider configs, setup different environments and debug OAuth issues |
60 | 42 |
|
61 | | -1. First, deploy your own instance of Pizzly by clicking a deploy button below: |
| 43 | +Pizzly is easy to try in 5 minutes and can be deployed in 15. |
62 | 44 |
|
63 | | - | Heroku | Platform.sh | |
64 | | - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
65 | | - | <a href="https://heroku.com/deploy?template=https://github.com/Bearer/Pizzly" rel="nofollow" target="_blank"><img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" width="184" height="40"></a> | <a href="https://console.platform.sh/projects/create-project/?template=https://github.com/Bearer/Pizzly&utm_campaign=deploy_on_platform?utm_medium=button&utm_source=affiliate_links&utm_content=https://github.com/Bearer/Pizzly" rel="nofollow"><img src="https://platform.sh/images/deploy/deploy-button-lg-blue.svg" alt="Deploy with Platform.sh" width="180" height="40"></a> | |
| 45 | +Start a **new OAuth flow with 2 lines of code in your frontend**: |
66 | 46 |
|
67 | | -2. Once deployed, open your app. You will land on Pizzly's dashboard. |
68 | | -3. Click on "Open Dashboard" and select the API you want to integrate with. |
69 | | -4. Now, configure the API by entering your credentials and scopes. That's all it takes to configure a new API. |
70 | | -5. To connect a user to this API, _in your frontend_, install [`pizzly-js`](src/clients/javascript): |
| 47 | +```ts |
| 48 | +var pizzly = new Pizzly('https://localhost:3004') |
71 | 49 |
|
72 | | - ```bash |
73 | | - npm install pizzly-js |
74 | | - ``` |
| 50 | +// Trigger an OAuth flow for the user to authenticate with Slack |
| 51 | +let result = await pizzly.auth('slack', '<user-id>') |
| 52 | +``` |
75 | 53 |
|
76 | | -6. Then open your frontend app and copy-paste the following code: |
| 54 | +Then **get and use the current access token in your backend** (with our SDK or a simple REST API): |
77 | 55 |
|
78 | | - ```js |
79 | | - import Pizzly from 'pizzly-js' |
| 56 | +```ts |
| 57 | +var slackAccessToken = await pizzly.accessToken('slack', '<user-id>') // Always fresh & ready to use |
| 58 | +``` |
80 | 59 |
|
81 | | - const pizzly = new Pizzly({ host: 'pizzly.example.org' }) // Initialize Pizzly |
82 | | - const myAPI = pizzly.integration('xxx-api-name') // Replace with the API slugname |
| 60 | +## 👾 Out of the box support for 50+ APIs |
83 | 61 |
|
84 | | - myAPI |
85 | | - .connect() |
86 | | - .then(({ authId }) => console.log('Sucessfully connected!', authId)) |
87 | | - .catch(console.error) |
88 | | - ``` |
| 62 | +More than 50 APIs are preconfigured to work out-of-the-box. Including: |
89 | 63 |
|
90 | | - This snippet code will open a popup in your browser to start an authorization flow with the provided API. On success you will obtain an `authId` which will be be used in the next step. |
| 64 | +- **CRM**: Front, Hubspot, Salesforce, etc. |
| 65 | +- **Accounting**: Xero, Sellsy, Zoho Books, etc. |
| 66 | +- **Developer tools**: GitHub, GitLab, BitBucket, Jira etc. |
| 67 | +- **Communication**: Gmail, Microsoft Teams, Slack, Zoom etc. |
| 68 | +- **Productivity**: Asana, Airtable, Google Drive, Google Calendar, Trello, Google sheets etc. |
| 69 | +- **Social**: Twitter, LinkedIn, Reddit, Facebook etc. |
| 70 | +- [and more...](https://github.com/NangoHQ/Pizzly/blob/master/packages/server/templates.yaml) |
91 | 71 |
|
92 | | -7. _In your frontend again_, use the previously obtained `authId` to perform a request to the API using the code below: |
| 72 | +If your favorite API is missing [open a GitHub issue](https://github.com/NangoHQ/Pizzly/issues/new) or [contribute it right away](https://docs.nango.dev/pizzly/contribute-api): The API configurations are just simple [entries in a YAML file](https://github.com/NangoHQ/Pizzly/blob/master/packages/server/templates.yaml). |
93 | 73 |
|
94 | | - ```js |
95 | | - myAPI |
96 | | - .auth('xxx-auth-id') // Replace with the authId previously obtained |
97 | | - .get('/xxx-endpoint') // Replace with a valid endpoint of the API |
98 | | - .then((response) => console.log(response)) |
99 | | - .catch(console.error) |
100 | | - ``` |
| 74 | +## 🛡️ Small, self-contained & ready for production |
101 | 75 |
|
102 | | - This example will perform a GET request to `/endpoint` of the API and will use the provided authId to authenticate the request. |
| 76 | +We built Pizzly because we wanted a simple and fast way to get (fresh) access tokens for any API that requires OAuth. |
103 | 77 |
|
104 | | -## Documentation |
| 78 | +On purpose Pizzly is small, focused on its one task and easy to deploy in production: |
105 | 79 |
|
106 | | -Guides, tutorials and references are all available on the [Docs](/docs). |
| 80 | +- It runs as a single docker container in your stack |
| 81 | +- Updating it is as simple as `docker pull` and restarting the container |
| 82 | +- Securing it for production is quick & easy |
| 83 | +- Our CLI helps you with all admin tasks (such as setting scopes, enabling APIs etc.) |
107 | 84 |
|
108 | | -## Examples |
| 85 | +Last but not least, Pizzly's active community continuously expands & updates the 50+ blueprints. So your OAuth flows & tokens will keep on working even 5 years down the road. |
109 | 86 |
|
110 | | -We have several examples [in the docs](/docs/examples.md) with different APIs. Here is the first one to get you started: |
| 87 | +## 🚀 Quickstart |
111 | 88 |
|
112 | | -```js |
113 | | -const pizzly = new Pizzly({ host: 'pizzly.example.org' }) // Initialize Pizzly |
114 | | -const github = pizzly.integration('github') |
| 89 | +Clone the repo and start Pizzly: |
115 | 90 |
|
116 | | -github |
117 | | - .connect() // Connect to GitHub |
118 | | - .then(({ authId }) => console.log('Sucessfully connected! with the authId:', authId)) |
119 | | - .catch((error) => console.error('It failed!', error)) |
| 91 | +```bash |
| 92 | +git clone https://github.com/NangoHQ/Pizzly.git |
| 93 | +cd Pizzly |
| 94 | +docker compose up |
120 | 95 | ``` |
121 | 96 |
|
122 | | -This example will trigger an OAuth dance to the GitHub API. |
123 | | - |
124 | | -💡 You'll notice that when a user is successfully connected, we received an `authId`; it's a power concept introduced by Pizzly. The `authId` acts as a reference to the OAuth payload (i.e. the `access_token` and `refresh_token`). While the `access_token` and `refresh_token` expire and/or change over time, the `authId` is always the same. Think of it as something like a user identity. |
| 97 | +Make sure you have a client ID & secret ready for the API you want to use, e.g. for GitHub [register it here](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app). Use `http://localhost:3004/oauth/callback` as the callback URL. |
125 | 98 |
|
126 | | -## Supported APIs |
| 99 | +Enable the GitHub API and add your OAuth client id & secret with the CLI: |
127 | 100 |
|
128 | | -[](/docs/supported-apis.md) |
129 | | - |
130 | | -More than 50 APIs are preconfigured to work out-of-the-box. Including: |
131 | | - |
132 | | -- **Communication**: Gmail, Microsoft Teams, Slack, Zoom; |
133 | | -- **CRM**: Front, Hubspot, Salesforce, etc. |
134 | | -- **Developer tools**: BitBucket, GitHub, GitLab, etc. |
135 | | -- **Finance**: Xero, Sellsy, Zoho Books, etc. |
136 | | -- **Productivity**: Asana, Google Drive, Google Sheets, Jira, Trello, etc. |
137 | | -- **Social**: Facebook, LinkedIn, Reddit, etc. |
138 | | -- **[and more...](/docs/supported-apis.md)** |
139 | | - |
140 | | -Each API consists of a JSON configuration file, stored within the `/integrations` directory. Here's an example with the GitHub configuration file ([`/integrations/github.json`](/integrations/github.json)): |
141 | | - |
142 | | -```json |
143 | | -{ |
144 | | - "name": "GitHub", |
145 | | - "auth": { |
146 | | - "authorizationURL": "https://github.com/login/oauth/authorize", |
147 | | - "tokenURL": "https://github.com/login/oauth/access_token", |
148 | | - "authType": "OAUTH2", |
149 | | - "tokenParams": {}, |
150 | | - "authorizationParams": {}, |
151 | | - "auth": { "accessType": "offline" } |
152 | | - }, |
153 | | - "request": { |
154 | | - "baseURL": "https://api.github.com/", |
155 | | - "headers": { |
156 | | - "Accept": "application/vnd.github.v3+json", |
157 | | - "Authorization": "token ${auth.accessToken}", |
158 | | - "User-Agent": "Pizzly" |
159 | | - } |
160 | | - } |
161 | | -} |
| 101 | +```bash |
| 102 | +npx pizzly config:create github github <client-id> <client-secret> "user,public_repo" |
162 | 103 | ``` |
163 | 104 |
|
164 | | -And adding new APIs is straightforward. Just create a new configuration file within the `/integrations` folder of your Pizzly's instance. If you feel like sharing, you can even create a PR so that other developers will be able to use it as well! |
| 105 | +CD to the demo page and start a small webserver to serve the demo page: |
165 | 106 |
|
166 | | -## Why Pizzly? |
| 107 | +```bash |
| 108 | +cd packages/frontend |
| 109 | +python3 -m http.server 8080 |
| 110 | +``` |
167 | 111 |
|
168 | | -Pizzly originally started at Bearer as a way to simplify the developer's journey and ease the building of API integrations. OAuth is a great framework, but the difficulty and wide range of implementation makes it painful to use and tends to slow down the ability to integrate with new APIs. |
| 112 | +Open the demo page in your browser at [http://localhost:8080/bin/sample.html](http://localhost:8080/bin/sample.html) and try the OAuth flow with `github` as the config key and `1` as the connection id. |
169 | 113 |
|
170 | | -_But seriously, why Pizzly? We're fan of bears and fell in love with this [sweet hybrid](https://en.wikipedia.org/wiki/Grizzly–polar_bear_hybrid) one 🐻_ |
171 | | - |
172 | | -## Contributing |
| 114 | +Once the flow is finished you can use our SDKs or REST API to get access tokens in the backend (automatically refreshed) and make API calls: |
| 115 | +```ts |
| 116 | +import Pizzly from '@nangohq/pizzly-node' |
| 117 | +let pizzly = new Pizzly('http://localhost:3004'); |
| 118 | +var githubAccessToken = await pizzly.accessToken('github', '1') // Always fresh & ready to use |
| 119 | +``` |
173 | 120 |
|
174 | | -While Pizzly is actively backed by Bearer's engineering team, the main purpose of this repository is to continue to improve Pizzly, making it larger and easier to use. We are grateful to each contributors and encourage you to participate by reporting bugs, ask for improvements and propose changes to the code. |
| 121 | +When you are ready to add Pizzly to your application read our [Getting started](https://docs.nango.dev/pizzly/getting-started) guide. |
175 | 122 |
|
176 | | -### Covenant Code of Conduct |
| 123 | +## ♻️ Easily sync data with Nango.Sync |
177 | 124 |
|
178 | | -Pizzly has adopted the Contributor Covenant Code of Conduct (version 2.0), available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. We expect project participants to adhere to. |
| 125 | +Pizzly gets you OAuth tokens so you can start making API calls. |
179 | 126 |
|
180 | | -### Contributing Guide |
| 127 | +If you need to continuously sync data from the external API (e.g. syncing in contacts, users, notes, tasks, issues, repos etc.) take a look at our sister project [Nango.Sync](https://github.com/NangoHQ/nango) (works with Pizzly tokens out of the box): |
181 | 128 |
|
182 | | -All work on Pizzly happens directly on [GitHub](https://github.com/bearer/pizzly). Both Bearer.sh team members and external contributors send pull requests which go through the same review process. Submit all changes directly to the [`master branch`](https://github.com/bearer/pizzly/tree/master). We don’t use separate branches for development or for upcoming releases. |
| 129 | +```ts |
| 130 | +Nango.sync('https://any.rest.api/any/endpoint', options) // Sync data from endpoint to your DB & keep it fresh |
| 131 | +``` |
183 | 132 |
|
184 | | -To report a bug or a feedback, use [GitHub Issues](https://github.com/bearer/pizzly/issues). We keep a close eye on this and try to label each new request. If you're fixing a bug or working on a new feature, submit a [pull request](https://github.com/Bearer/Pizzly/pulls) with detail on which changes you've made. |
| 133 | +Nango make syncing data from APIs to your database fast & flexible: It takes care of all the heavy lifting whilst giving you access to the full power of the API. |
185 | 134 |
|
186 | | -While there are no templates yet when opening a PR or an issue, we still recommend to provide as much detail as possible. Consider that someone external to the project should understand your request at first glance. |
| 135 | +## 🔍 Where to learn more |
187 | 136 |
|
188 | | -### License |
| 137 | +⭐ Follow our development by starring us here on GitHub ⭐ |
189 | 138 |
|
190 | | -Pizzly is MIT licensed. See the [LICENSE file](https://github.com/Bearer/Pizzly/blob/master/LICENSE.md) for more information. |
| 139 | +- Explore [the full list of supported APIs](https://github.com/NangoHQ/Pizzly/blob/master/packages/server/templates.yaml) |
| 140 | +- Easily sync data from any API with [`Nango.sync`](https://github.com/NangoHQ/nango) |
| 141 | +- [Contribute a new API](https://docs.nango.dev/pizzly/contribute-api) |
| 142 | +- Share feedback or ask questions on the [Slack community](https://nango.dev/slack) |
| 143 | +- Check our [blog on native integrations](https://www.nango.dev/blog) |
191 | 144 |
|
192 | | -## Sponsor |
| 145 | +## 🐻 History |
193 | 146 |
|
194 | | -Pizzly is proudly sponsored by Bearer, a solution to implement [data security as code](https://www.bearer.com) processes in developers' workflows and automate data detection and data flow mapping. |
| 147 | +Pizzly was originally developed by the team at [Bearer](https://www.bearer.com/?ref=pizzly) with contributions of more than 40+ individuals. Over time the focus of Bearer shifted and they could no longer maintain Pizzly. In late 2022 the team at [Nango](https://www.nango.dev) adopted the project and has since maintained and evolved it together with the growing Pizzly community. |
0 commit comments