[{"data":1,"prerenderedAt":416},["ShallowReactive",2],{"navigation":3,"page:\u002Fbase44":45},{"title":4,"links":5},"API reference",[6,9,12,15,18,21,24,27,30,33,36,39,42],{"title":7,"href":8},"Accounts","\u002Freference\u002Faccounts",{"title":10,"href":11},"Connect","\u002Freference\u002Fconnect",{"title":13,"href":14},"Calendars","\u002Freference\u002Fcalendars",{"title":16,"href":17},"Events","\u002Freference\u002Fevents",{"title":19,"href":20},"Availability","\u002Freference\u002Favailability",{"title":22,"href":23},"Meetings","\u002Freference\u002Fmeetings",{"title":25,"href":26},"Invitations","\u002Freference\u002Finvitations",{"title":28,"href":29},"Webhooks","\u002Freference\u002Fwebhooks",{"title":31,"href":32},"Metadata","\u002Freference\u002Fmetadata",{"title":34,"href":35},"Keys","\u002Freference\u002Fkeys",{"title":37,"href":38},"Sandbox","\u002Freference\u002Fsandbox",{"title":40,"href":41},"Usage","\u002Freference\u002Fusage",{"title":43,"href":44},"Logs","\u002Freference\u002Flogs",{"kind":46,"title":47,"description":48,"sections":49,"doc":74},"guide","Build with Base44","Add Google Calendar and Microsoft Outlook to a Base44 app. Connect the Pyas MCP server to Base44, and its AI adds the backend functions, the secret and the connect button.",[50,53,56,59,62,65,68,71],{"id":51,"title":52},"before-you-start","Before you start",{"id":54,"title":55},"add-pyas-to-base44","Add Pyas to Base44",{"id":57,"title":58},"ask-for-what-you-want","Ask for what you want",{"id":60,"title":61},"store-the-key","Store the key",{"id":63,"title":64},"what-base44-adds","What Base44 adds",{"id":66,"title":67},"receive-webhooks","Receive webhooks",{"id":69,"title":70},"go-live","Go live",{"id":72,"title":73},"disconnect","Disconnect",{"id":75,"title":47,"body":76,"description":48,"extension":406,"hero":407,"meta":408,"navigation":409,"path":410,"rawbody":411,"sections":49,"seo":412,"stem":413,"v1":414,"__hash__":415},"docs\u002Fbase44.md",{"type":77,"value":78,"toc":394},"minimark",[79,83,90,93,101,104,106,177,180,182,185,191,214,216,223,254,264,266,269,279,297,300,303,305,312,319,325,338,340,365,367,384],[80,81,47],"h1",{"id":82},"build-with-base44",[84,85,86],"lead",{},[87,88,89],"p",{},"Base44's AI can add Google Calendar and Microsoft Outlook to your app with Pyas. You connect the Pyas MCP server to Base44 once. The AI then gets the code for each task from Pyas, and you store a key as a secret. The key stays in backend functions, and the code works with the sandbox's sample people before anyone connects a real calendar.",[91,92,52],"h2",{"id":51},[87,94,95,96,100],{},"Base44 adds custom MCP servers and backend functions on its ",[97,98,99],"strong",{},"Builder"," plan and above. Both are needed here.",[87,102,103],{},"Base44's MCP tools work only in the editor chat, while you build. What the AI reads from Pyas there is written into your app as it was at that moment, and doesn't update in the published app. That's why the code Pyas gives the AI reads calendars from backend functions, which call Pyas each time your app needs the data.",[91,105,55],{"id":54},[107,108,109,120,130,155,164],"ol",{},[110,111,112,113,116,117,119],"li",{},"Select your workspace name at the bottom left, then ",[97,114,115],{},"Account preferences",", then ",[97,118,99],{},".",[110,121,122,123,126,127,119],{},"Under ",[97,124,125],{},"MCP Connections",", select ",[97,128,129],{},"Add custom MCP",[110,131,132,133,136,137,141,142,136,145,141,148,151,152,119],{},"For ",[97,134,135],{},"Name",", enter ",[138,139,140],"code",{},"Pyas",". For ",[97,143,144],{},"URL",[138,146,147],{},"https:\u002F\u002Fmcp.pyas.io\u002Fsandbox",[97,149,150],{},"Authentication",", choose ",[97,153,154],{},"OAuth",[110,156,157,158,116,161,119],{},"Select ",[97,159,160],{},"Test",[97,162,163],{},"Test & Add",[110,165,166,167,170,171,176],{},"Authorize the connection: sign in to Pyas, choose your app, and select ",[97,168,169],{},"Allow",". See ",[172,173,175],"a",{"href":174},"\u002Fai-tools#sign-in","Sign in"," for what each permission allows.",[87,178,179],{},"The connection is yours, and it works in every app you build in Base44. New tools from Pyas can take up to 15 minutes to appear.",[91,181,58],{"id":57},[87,183,184],{},"Ask in plain words, for example:",[186,187,188],"blockquote",{},[87,189,190],{},"Add a button that lets people connect their Google or Outlook calendar, and show their events for the next week.",[87,192,193,194,197,198,201,202,205,206,209,210,213],{},"The AI checks your setup with ",[138,195,196],{},"setup_status"," and gets the code for each task with ",[138,199,200],{},"get_recipe",". It adds your app's address, such as ",[138,203,204],{},"https:\u002F\u002Fyour-app.base44.app",", to the allowed origins with ",[138,207,208],{},"update_app",", and creates a test key with ",[138,211,212],{},"get_test_key",". You confirm the address in Pyas, from the link it gives you. Every response from Pyas ends with the next step, so the AI knows what to do next.",[91,215,61],{"id":60},[87,217,218,219,222],{},"Store the test key as a secret named ",[138,220,221],{},"PYAS_API_KEY",":",[107,224,225,238],{},[110,226,227,228,116,231,234,235,119],{},"In the app editor, open ",[97,229,230],{},"Dashboard",[97,232,233],{},"Secrets",", and select ",[97,236,237],{},"Add Secret",[110,239,240,241,243,244,247,248,251,252,119],{},"Enter ",[138,242,221],{}," as the ",[97,245,246],{},"Secret Name"," and the key as the ",[97,249,250],{},"Secret Value",", then select ",[97,253,237],{},[87,255,256,257,259,260,119],{},"The ",[97,258,233],{}," page appears once your app has a backend function. Don't paste the key into the chat. Backend functions read the secret on the server, and it never reaches the browser. A test key works only in your app's ",[172,261,263],{"href":262},"\u002Fsandbox","sandbox",[91,265,64],{"id":63},[87,267,268],{},"The code runs as backend functions:",[270,271,277],"pre",{"className":272,"code":274,"language":275,"meta":276},[273],"language-text","base44\u002Ffunctions\u002FpyasConnectSession\u002Fentry.ts  creates a connect session for the button\nbase44\u002Ffunctions\u002FpyasEvents\u002Fentry.ts          the person's events for the next 7 days\nbase44\u002Ffunctions\u002FpyasBook\u002Fentry.ts            books the first free 30 minutes tomorrow\nsrc\u002Fcomponents\u002FConnectCalendar.jsx            the \"Connect an account\" button\n","text","",[138,278,274],{"__ignoreMap":276},[87,280,281,282,285,286,289,290,293,294,119],{},"Your pages call each function by its name, such as ",[138,283,284],{},"pyasEvents",", with the app's Base44 client and ",[138,287,288],{},"base44.functions.invoke",". Each function reads the key with ",[138,291,292],{},"secrets.get('PYAS_API_KEY')",", and the signed-in person with Base44's ",[138,295,296],{},"auth.me()",[87,298,299],{},"With a test key, the functions use the sandbox's sample person, so the events and booking work right away. The connect button shows a message from Pyas that connecting a real calendar requires a live key. This is expected.",[87,301,302],{},"After you add a function or change a secret, publish the app again. The published app uses the functions and secrets it had when you last published it.",[91,304,67],{"id":66},[87,306,307,308,311],{},"Ask the AI to receive Pyas webhooks. It adds a ",[138,309,310],{},"pyasWebhooks"," function, which verifies the signature of each delivery against the raw body before it reads the event.",[87,313,314,315,318],{},"The AI adds the endpoint to your sandbox with ",[138,316,317],{},"create_webhook",", at your published address:",[270,320,323],{"className":321,"code":322,"language":275,"meta":276},[273],"https:\u002F\u002F\u003Cyour-app>.base44.app\u002Ffunctions\u002FpyasWebhooks\n",[138,324,322],{"__ignoreMap":276},[87,326,327,328,330,331,170,334,337],{},"Store the signing secret that ",[138,329,317],{}," returns as a secret named ",[138,332,333],{},"PYAS_WEBHOOK_SECRET",[172,335,28],{"href":336},"\u002Fwebhooks"," for the events Pyas sends.",[91,339,70],{"id":69},[107,341,342,345,351,362],{},[110,343,344],{},"In the Pyas dashboard, choose a plan and create a live key. Plans, payment and live keys are always done by you, in the dashboard.",[110,346,347,348,350],{},"Replace the ",[138,349,221],{}," secret with the live key, and publish the app again.",[110,352,353,354,357,358,361],{},"The functions now use the person signed in to your Base44 app. People who aren't signed in get a ",[138,355,356],{},"401"," response with the code ",[138,359,360],{},"SIGN_IN_REQUIRED",", so your app needs sign-in before people connect a calendar.",[110,363,364],{},"Add your published address to the app's allowed origins, and add a live webhook endpoint in the dashboard.",[91,366,73],{"id":72},[87,368,369,370,116,372,116,374,376,377,116,380,383],{},"In Base44, open ",[97,371,115],{},[97,373,99],{},[97,375,125],{},". Turn Pyas off to pause it, or open ",[97,378,379],{},"More actions",[97,381,382],{},"Remove MCP",", to remove it.",[87,385,386,387,390,391,393],{},"To stop Base44 from Pyas's side, open your profile in the Pyas dashboard. ",[97,388,389],{},"Connected tools"," lists Base44 with when it was last used, and ",[97,392,73],{}," stops it immediately.",{"title":276,"searchDepth":395,"depth":395,"links":396},3,[397,399,400,401,402,403,404,405],{"id":51,"depth":398,"text":52},2,{"id":54,"depth":398,"text":55},{"id":57,"depth":398,"text":58},{"id":60,"depth":398,"text":61},{"id":63,"depth":398,"text":64},{"id":66,"depth":398,"text":67},{"id":69,"depth":398,"text":70},{"id":72,"depth":398,"text":73},"md",false,{},true,"\u002Fbase44","---\ntitle: Build with Base44\ndescription: Add Google Calendar and Microsoft Outlook to a Base44 app. Connect the Pyas MCP server to Base44, and its AI adds the backend functions, the secret and the connect button.\nsections:\n  - { id: before-you-start, title: Before you start }\n  - { id: add-pyas-to-base44, title: Add Pyas to Base44 }\n  - { id: ask-for-what-you-want, title: Ask for what you want }\n  - { id: store-the-key, title: Store the key }\n  - { id: what-base44-adds, title: What Base44 adds }\n  - { id: receive-webhooks, title: Receive webhooks }\n  - { id: go-live, title: Go live }\n  - { id: disconnect, title: Disconnect }\n---\n\n# Build with Base44\n\n::lead\nBase44's AI can add Google Calendar and Microsoft Outlook to your app with Pyas. You connect the Pyas MCP server to Base44 once. The AI then gets the code for each task from Pyas, and you store a key as a secret. The key stays in backend functions, and the code works with the sandbox's sample people before anyone connects a real calendar.\n::\n\n## Before you start\n\nBase44 adds custom MCP servers and backend functions on its **Builder** plan and above. Both are needed here.\n\nBase44's MCP tools work only in the editor chat, while you build. What the AI reads from Pyas there is written into your app as it was at that moment, and doesn't update in the published app. That's why the code Pyas gives the AI reads calendars from backend functions, which call Pyas each time your app needs the data.\n\n## Add Pyas to Base44\n\n1. Select your workspace name at the bottom left, then **Account preferences**, then **Builder**.\n2. Under **MCP Connections**, select **Add custom MCP**.\n3. For **Name**, enter `Pyas`. For **URL**, enter `https:\u002F\u002Fmcp.pyas.io\u002Fsandbox`. For **Authentication**, choose **OAuth**.\n4. Select **Test**, then **Test & Add**.\n5. Authorize the connection: sign in to Pyas, choose your app, and select **Allow**. See [Sign in](\u002Fai-tools#sign-in) for what each permission allows.\n\nThe connection is yours, and it works in every app you build in Base44. New tools from Pyas can take up to 15 minutes to appear.\n\n## Ask for what you want\n\nAsk in plain words, for example:\n\n> Add a button that lets people connect their Google or Outlook calendar, and show their events for the next week.\n\nThe AI checks your setup with `setup_status` and gets the code for each task with `get_recipe`. It adds your app's address, such as `https:\u002F\u002Fyour-app.base44.app`, to the allowed origins with `update_app`, and creates a test key with `get_test_key`. You confirm the address in Pyas, from the link it gives you. Every response from Pyas ends with the next step, so the AI knows what to do next.\n\n## Store the key\n\nStore the test key as a secret named `PYAS_API_KEY`:\n\n1. In the app editor, open **Dashboard**, then **Secrets**, and select **Add Secret**.\n2. Enter `PYAS_API_KEY` as the **Secret Name** and the key as the **Secret Value**, then select **Add Secret**.\n\nThe **Secrets** page appears once your app has a backend function. Don't paste the key into the chat. Backend functions read the secret on the server, and it never reaches the browser. A test key works only in your app's [sandbox](\u002Fsandbox).\n\n## What Base44 adds\n\nThe code runs as backend functions:\n\n```text\nbase44\u002Ffunctions\u002FpyasConnectSession\u002Fentry.ts  creates a connect session for the button\nbase44\u002Ffunctions\u002FpyasEvents\u002Fentry.ts          the person's events for the next 7 days\nbase44\u002Ffunctions\u002FpyasBook\u002Fentry.ts            books the first free 30 minutes tomorrow\nsrc\u002Fcomponents\u002FConnectCalendar.jsx            the \"Connect an account\" button\n```\n\nYour pages call each function by its name, such as `pyasEvents`, with the app's Base44 client and `base44.functions.invoke`. Each function reads the key with `secrets.get('PYAS_API_KEY')`, and the signed-in person with Base44's `auth.me()`.\n\nWith a test key, the functions use the sandbox's sample person, so the events and booking work right away. The connect button shows a message from Pyas that connecting a real calendar requires a live key. This is expected.\n\nAfter you add a function or change a secret, publish the app again. The published app uses the functions and secrets it had when you last published it.\n\n## Receive webhooks\n\nAsk the AI to receive Pyas webhooks. It adds a `pyasWebhooks` function, which verifies the signature of each delivery against the raw body before it reads the event.\n\nThe AI adds the endpoint to your sandbox with `create_webhook`, at your published address:\n\n```text\nhttps:\u002F\u002F\u003Cyour-app>.base44.app\u002Ffunctions\u002FpyasWebhooks\n```\n\nStore the signing secret that `create_webhook` returns as a secret named `PYAS_WEBHOOK_SECRET`. See [Webhooks](\u002Fwebhooks) for the events Pyas sends.\n\n## Go live\n\n1. In the Pyas dashboard, choose a plan and create a live key. Plans, payment and live keys are always done by you, in the dashboard.\n2. Replace the `PYAS_API_KEY` secret with the live key, and publish the app again.\n3. The functions now use the person signed in to your Base44 app. People who aren't signed in get a `401` response with the code `SIGN_IN_REQUIRED`, so your app needs sign-in before people connect a calendar.\n4. Add your published address to the app's allowed origins, and add a live webhook endpoint in the dashboard.\n\n## Disconnect\n\nIn Base44, open **Account preferences**, then **Builder**, then **MCP Connections**. Turn Pyas off to pause it, or open **More actions**, then **Remove MCP**, to remove it.\n\nTo stop Base44 from Pyas's side, open your profile in the Pyas dashboard. **Connected tools** lists Base44 with when it was last used, and **Disconnect** stops it immediately.\n",{"title":47,"description":48},"base44",null,"GeG1hd0_U-jCbSzJgA7PzexoMgV3bBGFUctESLhx9So",1794697270454]