chore: moved docs into mintlify (#18536)

This commit is contained in:
Peer Richelsen authored and GitHub committed 2025-01-08 23:01:53 +01:00
1 parent 9b2161cc19
commit eba335c903
120 files changed
+2294 -90

No files matched your search

@@ -0,0 +1,20 @@
---
title: "Adding your first app"
---
Head over to the **apps** page, where you'll find our app store. We suggest firstly adding a calendar integration, then optionally a video conferencing platform, and then try out the other apps.
<Frame>
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/V6mwvgcAxi0?si=SIdKJt4JyWTZXba4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</Frame>
Find the app you'd like to install, and either click **Install** in the top right of that app's card to add it right away, or click on the app's card to view more details.
In the details page you can read more about each app, then click **Install** in the top right of the page to add it to your account.
<Frame>
<img src="/images/i1599x929-tUttNKwBum0Z_p1vwkt.png"
legend="The app details page for Google calendar" />
</Frame>
If the app requires authentication, for instance to connect your Google Account, a dialog will be opened prompting you to authenticate. Once complete, the app will be successfully installed.
+11
View File
@@ -0,0 +1,11 @@
---
title: "App Store"
---
The whole idea behind Cal.com is to make scheduling easy, we want it to be an effortless process, and we want everybody to be able to access it.
With this in mind, we built an app store. Our apps let you extend cal.com features, and makes integrating other services effortless. This makes it easy to customize your cal.com experience. Apps can be used to do things like add extra calendar connections or host a virtual team-building session.
The Cal app store also makes it easy to coordinate things like podcast production, twitch streaming, and CMS outreach. With Cal.com, calendar scheduling is simple, effortless and whenever you need it to be fun.
Currently, we have 45+ apps in our app store which can assist you in your scheduling experience, from Calendar apps to Automation apps. You can use the built-in search bar to look for the app quickly if you'd prefer that.
+15
View File
@@ -0,0 +1,15 @@
---
title: "Apps"
---
Apps are extensions within Cal.com that extend the functionality of the software. Most commonly, apps are integrations with various calendar providers, video conferencing software and other platforms. However, apps also provide the ability to add extra features to the software, such as the _Wipe my cal_ app which offers the ability to mass-reschedule your entire day. Check out the Cal.com [app store](https://cal.com/apps) now
<Note>
**Looking to build an app for Cal.com?** Check out our [guide](https://cal.com/docs/how-to-guides/how-to-build-an-app) for more information on building an app for our app store.
</Note>
Clicking **Apps** in the sidebar will take you to the app store, which is the marketplace to find and install apps. They are divided into categories which you can browse through.
You can click on any app's card to view the detailed view, which gives you a description for the app, as well as additional information about it. If you want to install it, simply hit the **Install** button and it will be added. If the app requires authentication, for instance to connect your Google Account, a dialog will be opened prompting you to authenticate. Once complete, the app will be successfully installed.
Clicking on **Installed apps** in the sidebar takes you to a page detailing which apps you have installed and any relevant settings for them. Here, you can do things like enabling and disabling certain calendars, adding webhooks, uninstalling apps and more.
@@ -0,0 +1,33 @@
---
title: Assign people to a call from a CRM or database
---
## Option #1 Based on CRM integration
If you are working with a CRM such as Salesforce, Hubspot, Close.com or similar, you can use our integrations to connect to your apps.
We're using the Assignee APIs from each service to understand which person is assigned to an email of a new lead.
By prefilling your booking link with ?email=[[email protected]](https://cal.com/help/en/articles/) our integration will look up who has spoken to [[email protected]](https://cal.com/help/en/articles/) before and skip all round-robin logic.
Here is an example URL: i.cal.com/sales/exploration?email=[[email protected]](https://cal.com/help/en/articles/)
This works with Embeds as well, just add the parameter to your CalLink property.
## Option #2 Based on Emails
If you are using a different product that we don't integrate with, or you need something more custom you can also achieve this with our Organization plan.
We've built our Organization system in a way where every email can be turned into a scheduling link with your company subdomain:
[[email protected]](https://cal.com/help/en/articles/) → acme.cal.com/jane (or schedule.acme.com/jane)
This means if you have a table:
| **User** | **AccountExecutive** |
| --- | --- |
| [[email protected]](https://cal.com/help/en/articles/) | [[email protected]](https://cal.com/help/en/articles/) |
You could show [[email protected]](https://cal.com/help/en/articles/) an embed inside your application simply by using the value from AccountExecutive to build the link:
[[email protected]](https://cal.com/help/en/articles/) → acme.cal.com/jane either with a string replace function or a simple regex.
@@ -0,0 +1,78 @@
---
title: "Build a greeter app"
---
## Building a **Greeter** app
**Step 1:** Create an app with the title "**Greeter".** Run the following command and provide the information it is looking for.
```
yarn app-store create
```
<Frame>
<iframe src="https://www.loom.com/embed/b0fd31cc11444799af7a6f12a01d4321" width="100%" height="100%" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</Frame>
**Step 2:** App is created now. Go and install it.
**Step 3:** The app is installed but it doesn't do anything because we haven't written any code to make it do something. Let's add a button in the main navigation that greets the user
1. Create a component `greeter/components/GreeterButton.tsx` - You can name it whatever you want.
2. Import this component in `Shell.tsx` and add it wherever you want to so that the button is available on all pages.
```js
/**
* GreeterButton.tsx
* It creates a button that can be added anywhere. The button is visible only if the app is installed.
*/
import useApp from "@calcom/lib/hooks/useApp";
import showToast from "@calcom/lib/notification";
import { Button } from "@calcom/ui";
import useMeQuery from "@lib/hooks/useMeQuery";
export default function GreeterButton() {
const { data: user } = useMeQuery();
const { data: greeterApp } = useApp("greeter");
// Make sure that greeterApp is installed. We shouldn't show the button when app is not installed
if (!user || !greeterApp) {
return null;
}
return (
<Button
onClick={() => {
showToast("Hello, " + user.name, "success");
}}
>
Greet Me!
</Button>
);
}
```
```;
/**
* Shell.tsx
*/
// ...
import GreeterButton from "@calcom/app-store/greeter/components/GreeterButton";
// ...
<GreeterButton />;
```
<Frame>
<img src="/images/i1280x250-dXnl-QuzSMbl_xydd9y.png" />
</Frame>
A sample line where I used the component in the demo
<Frame>
<iframe src="https://www.loom.com/embed/b0fd31cc11444799af7a6f12a01d4321" width="100%" height="100%" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</Frame>
That's it. You now have a fully functional Greeter app. This is the simplest possible demonstration of how you can build an app and what it can do. There are simply no restrictions on what an app can achieve.
@@ -0,0 +1,80 @@
---
title: "How to build an app"
---
Since Cal.com is open source we encourage developers to create new apps for others to use. This guide is to help you get started.
You can create an app by simply running the following command. It creates a new directory under [`packages/app-store/`](https://github.com/calcom/cal.com/tree/main/packages/app-store)``
```
yarn create-app
```
You just need to provide a few inputs and then you will have your app created within a few seconds. [See, how you can build a very simple app that greets your users.]()
### Steps in creating an app
* Create the app using the `create-app` command
* The app can be installed now. But at this moment it isn't doing anything. It is just installed and ready to do what you want it to do.
* There is pretty much no restriction on what an App can do. Some of the examples are:
* Hooking into existing functionalities to enhance them - _In all these cases you need to first check if the app is installed or not. There is_ `_useApp(appSlug)_` _react hook to do that. It gives you the app details if the app is installed._
* Apps that need to connect with third parties like Google Calendar, Apple Calendar, Google Meet.
* A super powerful app that has its own data and pages - [Routing Forms App](https://github.com/calcom/cal.com/tree/main/packages/app-store/ee/routing_forms) is a great example of this.
* There are so many powerful apps already in the [App Store](https://app.cal.com/apps) for time. You can get an idea of what the apps can do from it.
### Structure
All apps can be found under [`packages/app-store`](https://github.com/calcom/cal.com/tree/main/packages/app-store). In this folder is `_baseApp` which shows the general structure of an app.
```
├──_example
| ├──config.json -> Autogenerated by cli. You are free to edit it.
| ├──api
| | ├──add.ts -> Autogenerated by cli. You would want to edit it if your app needs to connect with a third party
|
| ├──components
|
| ├──static -> Add all static assets here
| | ├──icon.svg -> This is used as the logo for your App.
| ├──index.ts
| ├──package.json
| ├──.env.example -> Specify the environmental variables (ex. auth token, API secrets) that your app will need if it's applicable
| ├──README.mdx -> Customize your app description. You can add an image slider as well.
```
### Other Commands
**Deleting an app:**
```
yarn app-store delete --slug APP_NAME
```
**Editing an app:**
```
yarn app-store edit --slug APP_NAME
```
### Important Points
* Make sure to have `yarn app-store:watch` command running when developing an app so that autogenerated files are always up to date.
* If app-store cli fails at this step, try to run this command manually first. Solve that problem and then re-run cli. The command can fail because there are Prisma migrations that can't be applied automatically.
<Frame>
<img src="/images/i1600x120-WfEdMhsOOLSg_sitk6a.png" />
</Frame>
A sample failure in create command
* When you edit an app following things aren't updated.
* README.mdx - It would still have the old description. Feel free to edit it manually.
### Publishing Your App to the Cal.com App Store
Once your app is working in your environment, you can publish it to Cal.com App Store by opening a PR [here](https://github.com/calcom/cal.com).
If you need any help feel free to join us on [Discord](https://go.cal.com/discord).
+72
View File
@@ -0,0 +1,72 @@
---
title: "How to use OAuth to authorize apps with cal.com accounts"
---
As an example, you can view our OAuth flow in action on Zapier. Try to connect your cal.com account [here](https://zapier.com/apps/calcom/integrations).
To enable OAuth in one of your apps, you will need a Client ID, Client Secret, Authorization URL, Access Token Request URL, and Refresh Token Request URL.
<Frame>
<img src="/images/oauth-zapier.png" />
</Frame>
### OAuth Client Credentials
Only the cal.com team can create new OAuth clients. Please contact us at [[email protected]](mailto:[email protected]) with the following details: client name, redirect URI (provided by the app), app logo, and a link to the app.
The Cal.com team will register the app and provide you with the Client ID and Client Secret. Keep these credentials confidential and secure.
### Authorization URL
To initiate the OAuth flow, direct users to the following authorization URL:
- `https://app.cal.com/auth/oauth2/authorize`
- URL Parameters:
- *client_id*
- *state*: A securely generated random string to mitigate CSRF attacks
- *redirect_uri*: This is where users will be redirected after authorization
- *scope*: Specify the required scopes. Current scopes include READ_BOOKING and READ_PROFILE. Additional scopes can be added as needed.
After users click *Allow*, they will be redirected to the redirect_uri with the code (authorization code) and state as URL parameters.
### Access Token Request
Endpoint: `POST https://app.cal.com/api/auth/oauth/token`
Request Body:
- *code*: The authorization code received in the redirect URI
- *client_id*
- *client_secret*
- *grant_type*: "authorization_code"
- *redirect_uri*
Response:
```
{
access_token: “exampleAccessToken”
refresh_token: “exampleRefreshToken”
}
```
### Refresh Token Request
Endpoint: `POST https://app.cal.com/api/auth/oauth/refreshToken`
Request Body:
- *grant_type*: "refresh_token"
- *client_id*
- *client_secret*
Response:
```
{
access_token: “exampleAccessToken”
}
```
### Testing OAuth Credentials
To verify the correct setup and functionality of OAuth credentials you can use the following endpoint:
`GET https://app.cal.com/api/auth/oauth/me`
Headers:
- Authorization: Bearer *exampleAccessToken*
### Authorize requests with Bearer token
Ensure that Cal.com endpoints accessed by the app support authentication via Bearer Token.
If this is not the case, it will be necessary to update the code accordingly.
Here is an example of an endpoint that supports both apiKey and Bearer token authentication: [/listBookings endpoint](https://github.com/calcom/cal.com/blob/main/packages/app-store/zapier/api/subscriptions/listBookings.ts)
@@ -0,0 +1,35 @@
---
title: "How to use open-source scheduling infrastructure with HubSpot"
---
To use Cal.com with HubSpot, you only need two things:
1. You need to have an account on both platforms
2. You'll need to go to the [HubSpot app page](https://app.cal.com/apps/hubspot) and click the "Install" button ⬇
<Frame>
<img src="/images/i1599x807-x2DRUUT-DkbF_yljih9.png" />
</Frame>
3. After clicking the "Install" button, you will need to select the HubSpot account you want to use Cal.com with⬇
<Frame>
<img src="/images/i1600x1287-XKGU-PMvAkrB_zq004d.png" />
</Frame>
4. Then, you will need to give the listed permissions to Cal.com clicking the button "Connect app" in order to manage certain aspects of your account, in order to provide you with the functionality you are looking for. By the way, we are making our app official with HubSpot, so you will not be seeing the warning very soon ⬇
<Frame>
<img src="/images/i1600x1253-8BQ3KGqrqGTp_xrhqzd.png" />
</Frame>
5. Done! You will be redirected to Cal.com Installed Apps showing your newly installed app ready for you to take advantage of ⬇
<Frame>
<img src="/images/i1600x813-fFKsveiL2GuM_wk8cv1.png" />
</Frame>
@@ -0,0 +1,44 @@
---
title: "How to sync third party apps with a self-hosted Cal.com instance"
---
1. Add the required variables in your `.env` file
1. `CALCOM_WEBHOOK_SECRET`
1. You can generate this by running `openssl rand -base64 32`. This is required when sending 3rd party app credentials from your platform to your instance of Cal.com.
2. On your self-hosted instance of Cal.com visit settings/admin/apps under an admin account. Here you can enable/disable apps on Cal.com and set the app keys (client id, client secret, etc.). These keys should match the ones on your platform.
3. `CALCOM_WEBHOOK_HEADER_NAME`
1. The header name is expected to contain the webhook secret. The default is `calcom-webhook-secret`
5. `CALCOM_CREDENTIAL_SYNC_ENDPOINT`
1. The endpoint on your platform that your instance of [Cal.com](http://Cal.com) will make a request to if the 3rd party app credentials are expired.
5. `CALCOM_APP_CREDENTIAL_ENCRYPTION_KEY`
1. When sending 3rd party app credentials between your platform and your instance Cal.com, we expect these to be encrypted using AES256. When you encrypt the 3rd party app credentials, ensure the same key is used.
2. When a user adds a 3rd party app on your platform, you should send the credentials that are created to your instance of [Cal.com](http://Cal.com) to `${CALCOM_WEBAPP_URL}/api/webhook/app-credential` . The payload should contain the following
```javascript
{
// UserId of the Cal.com user
userId: number;
// The app slug that is on Cal.com.
// Can be found in the Cal.com database in the App table
appSlug: string;
// The credentials from the 3rd party app. (ex. Access token, refresh token).
// Ideally it should contain the access token and expiry date
// AES256 encrypted with CALCOM_APP_CREDENTIAL_ENCRYPTION_KEY
keys: string;
}
```
3. When [Cal.com](http://Cal.com) needs to refresh the app credentials it will make a request to `CALCOM_CREDENTIAL_SYNC_ENDPOINT`. The request contains the following.
```javascript
{
calcomUserId: string;
// App slug on Cal.com
appSlug: string;
}
```
<Note>
This only works if you have integrated [Cal.com](http://cal.com/) into your platform. Users **must** consent to give access to your platform, and you are simply using [Cal.com](http://cal.com/)'s code within your platform.
</Note>