diff --git a/package.json b/package.json index 8a976aa25..717bb4739 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@appwrite.io/console": "^0.4.2", "@appwrite.io/pink": "0.1.0-next.9", "@appwrite.io/pink-icons": "0.1.0-next.9", - "@appwrite.io/repo": "github:appwrite/appwrite#feat-rc-sdks", + "@appwrite.io/repo": "github:appwrite/appwrite#main", "@melt-ui/pp": "^0.3.0", "@melt-ui/svelte": "^0.74.3", "@playwright/test": "^1.42.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49dde56f0..126240c15 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,8 +23,8 @@ devDependencies: specifier: 0.1.0-next.9 version: 0.1.0-next.9 '@appwrite.io/repo': - specifier: github:appwrite/appwrite#feat-rc-sdks - version: github.com/appwrite/appwrite/0e28a3016c8f503df2b962e35f4a125335640386 + specifier: github:appwrite/appwrite#main + version: github.com/appwrite/appwrite/e868ae60c6db9d0dcbc5ce27a0ca609a7ceada7f '@melt-ui/pp': specifier: ^0.3.0 version: 0.3.0(@melt-ui/svelte@0.74.3)(svelte@4.2.12) @@ -6707,8 +6707,8 @@ packages: engines: {node: '>=12.20'} dev: true - github.com/appwrite/appwrite/0e28a3016c8f503df2b962e35f4a125335640386: - resolution: {tarball: https://codeload.github.com/appwrite/appwrite/tar.gz/0e28a3016c8f503df2b962e35f4a125335640386} + github.com/appwrite/appwrite/e868ae60c6db9d0dcbc5ce27a0ca609a7ceada7f: + resolution: {tarball: https://codeload.github.com/appwrite/appwrite/tar.gz/e868ae60c6db9d0dcbc5ce27a0ca609a7ceada7f} name: '@appwrite.io/repo' version: 0.0.0 dev: true diff --git a/src/lib/layouts/DocsArticle.svelte b/src/lib/layouts/DocsArticle.svelte index 48a20c5d2..7a37d13ce 100644 --- a/src/lib/layouts/DocsArticle.svelte +++ b/src/lib/layouts/DocsArticle.svelte @@ -30,9 +30,7 @@ {#if back}
+
+ +``` + +### Adding data to Appwrite Database + +To add or get information from the database, we created a database library in the project. The `add` function adds the Discord username and email to our collection. The `list` function gets the list of all documents in our collection and returns it after reformatting for our roulette wheel for the giveaway. + +```js +// ./src/lib/database.js + +import { Query, ID } from 'appwrite'; +import { database } from './appwrite'; +import { COLLECTION_NAME, DATABASE_NAME } from './constants'; + +export const db = { + list: async () => { + var entries = await database.listDocuments(DATABASE_NAME, COLLECTION_NAME, [ + Query.limit(500), + Query.select(['discordName']) + ]); + + var options = []; + + entries.documents.forEach((entry) => { + options.push({ label: entry.discordName }); + }); + + return { options: options, total: entries.total }; + }, + + add: async (discordName, email) => { + try { + await database.createDocument(DATABASE_NAME, COLLECTION_NAME, ID.unique(), { + discordName: discordName, + email: email + }); + console.log('Added to the raffle'); + } catch (error) { + console.log(error.message); + } + } +}; +``` + +We integrated the `add` function directly into the `success` endpoint for our OAuth process so that the user’s information could be added to the database as soon as we had a successful login. We use Svelte’s `onMount` function to achieve this as soon as our page is rendered in the DOM. + +```js +// .src/routes/success/+page.svelte + + + + + +
+

Success!

+

Thanks for participating in the giveaway, {userId}

+
+``` + +### Creating our giveaway roulette + +To create our giveaway roulette, we used an NPM package [`spin-wheel`](https://www.npmjs.com/package/spin-wheel). To set this up, we first used a `load` function to get the list of Discord usernames that were already available in the collection before the giveaway page was rendered. + +```js +// .src/routes/giveaway/+page.js + +import { db } from '$lib/database'; + +export async function load() { + var dbResponse = await db.list(); + + return { + entries: dbResponse.options, + total: dbResponse.total + }; +} +``` + +Using the load function would ensure that this list would be available on our page as soon as it gets rendered. We used this list with the `spin-wheel` package to generate a roulette wheel. As a bonus, we also integrated Appwrite Realtime to add new Discord usernames to our list and regenerate the wheel with the updated data. We let the winner selection remain mathematically random and used the `spin-wheel` package to spin the roulette wheel and show us the winner. The wheel spinning function also required us to install an additional NPM package `easing-utils` to select the easing function defining the rate of change in the rotation speed of the wheel. + +```js +// .src/routes/giveaway/+page.svelte + + + +
+ +
+
+
+ +
+``` + +# Outcome + +The giveaway roulette app was used over 450 times by 230+ different users across the different Init events we hosted. The application is still live and can be tried through the following links: + +- Participate in the giveaway roulette: [giveaway.appwrite.io](https://giveaway.appwrite.io) +- Giveaway roulette: [giveaway.appwrite.io/giveaway](https://giveaway.appwrite.io/giveaway) + +You can find the application’s complete source code at this [GitHub Repo](https://github.com/adityaoberai/InitGiveawayRoulette). + +[Join us on Discord](http://appwrite.io/discord) to be the first to get updates and to be part of a vibrant community! diff --git a/src/routes/blog/post/celebrating-1.5-contributors/+page.markdoc.draft b/src/routes/blog/post/celebrating-1.5-contributors/+page.markdoc similarity index 99% rename from src/routes/blog/post/celebrating-1.5-contributors/+page.markdoc.draft rename to src/routes/blog/post/celebrating-1.5-contributors/+page.markdoc index 525209d15..eb0a27900 100644 --- a/src/routes/blog/post/celebrating-1.5-contributors/+page.markdoc.draft +++ b/src/routes/blog/post/celebrating-1.5-contributors/+page.markdoc @@ -2,7 +2,7 @@ layout: post title: "Appwrite 1.5: celebrating the contributors" description: Appreciating the contributors from our community who help shape Appwrite as it is today. -date: 2024-03-01 +date: 2024-03-06 cover: /images/blog/celebrating-1.5-contributors.png timeToRead: 5 author: aditya-oberai diff --git a/src/routes/blog/post/how-to-build-your-digital-event-tickets/+page.markdoc b/src/routes/blog/post/how-to-build-your-digital-event-tickets/+page.markdoc index f8e2fb18d..3d75f0604 100644 --- a/src/routes/blog/post/how-to-build-your-digital-event-tickets/+page.markdoc +++ b/src/routes/blog/post/how-to-build-your-digital-event-tickets/+page.markdoc @@ -9,13 +9,13 @@ author: laura-du-ry category: engineering --- -Do you remember the Appwrite [Cloud cards](https://dev.to/appwrite/how-we-implemented-the-card-animation-in-appwrite-cloud-public-beta-4npb)? They were an absolute hit and filled our entire timeline for days. For Init, we wanted to create a new card, or better yet, a ticket to celebrate in style. So, we created three types of tickets that are unique to you with the help of your GitHub contributions and the tribe customization. +Do you remember the Appwrite [Cloud cards](https://dev.to/appwrite/how-we-implemented-the-card-animation-in-appwrite-cloud-public-beta-4npb)? They were an absolute hit and filled our entire timeline for days. For Init, we wanted to create a new card, or better yet, a ticket to celebrate in style. So, we created three types of tickets that are unique to you with the help of your GitHub contributions and the tribe customization. As always, we want to share our learning so you can create your own tickets with GitHub OAuth and grid integration. # Ticket design inspiration -Let’s start with the inspiration for the tickets. A few team members went to GitHub Universe in November 2023 and received a unique, customizable event badge with a grid on the side. These physical [event tickets](https://twitter.com/didier_lopes/status/1724925458762936817) inspired our very own Init tickets that would convey the feeling of a real ticket to an event. +Let’s start with the inspiration for the tickets. A few team members went to GitHub Universe in November 2023 and received a unique, customizable event badge with a grid on the side. These physical [event tickets](https://twitter.com/didier_lopes/status/1724925458762936817) inspired our very own Init tickets that would convey the feeling of a real ticket to an event. We took this idea, made it our own, and created three different types of tickets that would celebrate Init. The different types are categorized into: @@ -53,7 +53,7 @@ An essential part of the ticket is that we wanted to emphasize the importance of As you can see on each side of the ticket, a grid resembles your unique GitHub contributions over the past year, just like on your GitHub profile. You can choose to add the grid with a toggle, but to do so, you need to connect your GitHub account. -Now, in case you would like to know how you can do this, we asked the engineer in charge, [Thomas G Lopez](https://github.com/TGlide), to explain the process. +Now, in case you would like to know how you can do this, we asked the engineer in charge, [Thomas G Lopes](https://github.com/TGlide), to explain the process. ## Associating your GitHub account with your ticket @@ -67,17 +67,16 @@ By following our [documentation on OAuth](https://appwrite.io/docs/products/auth Now that the association part is done, it’s time to integrate the more interesting part, the GitHub contributions grid. -There are two ways to achieve this. The first one, is using the GraphQL API. [This article](https://medium.com/@yuichkun/how-to-retrieve-contribution-graph-data-from-the-github-api-dc3a151b4af) was initially used as a source of inspiration when implementing this feature. However, with this data, you only get the number of contributions but not the actual chart. +There are two ways to achieve this. The first one, is using the GraphQL API. [This article](https://medium.com/@yuichkun/how-to-retrieve-contribution-graph-data-from-the-github-api-dc3a151b4af) was initially used as a source of inspiration when implementing this feature. However, with this data, you only get the number of contributions but not the actual chart. -In GitHub's chart, each square can have a level from 0 to 4, where each level is brighter than the other, indicating more contributions. We need a way to convert those numbers of contributions to levels, but unfortunately, that algorithm is not exposed by GitHub. +In GitHub's chart, each square can have a level from 0 to 4, where each level is brighter than the other, indicating more contributions. We need a way to convert those numbers of contributions to levels, but unfortunately, that algorithm is not exposed by GitHub. We wanted the contribution chart to be as close to reality as possible. So, we arrived at our second solution: getting the chart from the source! -Our website is developed with SvelteKit, which is a full-stack framework. TL;DR, we have control over both the server and the client. So, when someone requests their ticket, we can make the server directly access your GitHub profile page and read the chart! We used a library called `node-html-parser` to deal with the HTML data. +Our website is developed with SvelteKit, which is a full-stack framework. TL;DR, we have control over both the server and the client. So, when someone requests their ticket, we can make the server directly access your GitHub profile page and read the chart! We used a library called `node-html-parser` to deal with the HTML data. We then can generate a matrix that representes the contribution chart. Each array of the matrix will represent a week, and each item of said array will contain the contribution level for that particular day. - ```ts const res = await fetch(`https://github.com/${gh_user}`); @@ -168,7 +167,7 @@ export const load = async () => { }; ``` -Then, with SvelteKit, we can show the contributions as soon as they're ready. +Then, with SvelteKit, we can show the contributions as soon as they're ready. ```svelte {#await contributions then c} @@ -202,6 +201,6 @@ Thomas explained the cool part of how we managed to make your ticket truly uniqu You can find the entire source code for the tickets on [GitHub](https://github.com/appwrite/console/blob/cloud-1.1.x/src/routes/card/Card.svelte) to create your digital event tickets. In May, we created a [showcase site](https://appwrite-card-snippets.vercel.app/popup) for the Cloud cards on how to add a pop, rotation, and glare to the cards. We advise you to check it out to make your tickets all the more magical. -Although Init is over, you can still get yourself a ticket at https://appwrite.io/init/ticket +Although Init is over, you can still get yourself a ticket at [appwrite.io/init/tickets](/init/tickets) [Join us on Discord](http://appwrite.io/discord) to be the first to get updates and to be part of a vibrant community! diff --git a/src/routes/blog/post/the-evolution-of-team-appwrite/+page.markdoc b/src/routes/blog/post/the-evolution-of-team-appwrite/+page.markdoc index c842c0baf..3b7764470 100644 --- a/src/routes/blog/post/the-evolution-of-team-appwrite/+page.markdoc +++ b/src/routes/blog/post/the-evolution-of-team-appwrite/+page.markdoc @@ -19,7 +19,7 @@ To kick off, the very first Appwrite employee, [Eldad Fux](https://github.com/el After the first funding round, there was financial power to hire the first engineers of Appwrite. Here is an overview of the very first engineers who joined the team and how they stood out. -[Christy Jacob](https://github.com/christyjacob4) is currently the Lead Engineer building out Appwrite Cloud. But before that, he was one of the very first active contributors to Appwrite, and at only 23 years old, he joined the team as a Founding Engineer. After being hired, he went above and beyond to help Appwrite grow. Besides coding, he handled social channels and took care of most of the copywriting work, as well as other marketing and growth-related work. +[Christy Jacob](https://github.com/christyjacob4) is currently the Lead Engineer building out Appwrite Cloud. But before that, he was one of the very first active contributors to Appwrite, and at only 23 years old, he joined the team as a Founding Engineer. After being hired, he went above and beyond to help Appwrite grow. Besides coding, he handled social channels and took care of most of the copywriting work, as well as other marketing and growth-related work. [Damodar Lohani](https://github.com/lohanidamodar) is a Flutter enthusiast, and in his search for a proper Backend-as-a-Service, he discovered Appwrite. Not much later, he dedicated an entire [YouTube channel](https://www.youtube.com/@appwriters) to videos on Appwrite and Flutter and contributed to Appwrite’s Flutter SDK. If you want to know what to do to get hired by Appwrite, or any other OSS company, he is a leading example. Making contributions in both code and content definitely gets you noticed. @@ -43,7 +43,7 @@ If you know Appwrite, you know [Steven Nguyen](https://github.com/stnguyen90). N # Contributing in general -Now, we don’t only hire people from our own community. We, and other tech companies, appreciate contributing in general. [Thomas G Lopez](https://github.com/TGlide/), a front-end dev, is one of the people who has made notable contributions within the Svelte community. He even built [Melt UI](https://melt-ui.com/docs/introduction), an open-source collection of accessible and customizable component builders for creating user interfaces with Svelte. His contributions earned him the notable title of an official Svelte Ambassador. +Now, we don’t only hire people from our own community. We, and other tech companies, appreciate contributing in general. [Thomas G Lopes](https://github.com/TGlide/), a front-end dev, is one of the people who has made notable contributions within the Svelte community. He even built [Melt UI](https://melt-ui.com/docs/introduction), an open-source collection of accessible and customizable component builders for creating user interfaces with Svelte. His contributions earned him the notable title of an official Svelte Ambassador. If you have been around the Appwrite community, you must know [Aditya Oberai](https://github.com/adityaoberai) by now. He actively participates in the larger tech and hackathon community and stumbled across Appwrite by chance on X. Now, one thing you need to know about Aditya is his unfair advantage: he is a networker. So when he discovered Appwrite, he noticed that he already knew many other contributors, which drew him in further and helped him land a job at Appwrite. @@ -53,7 +53,7 @@ If you have been around the Appwrite community, you must know [Aditya Oberai](ht # How to stand out from the crowd -Finding the right team members is crucial for tech start-ups. When you are still building your company, there is little room for error, especially when building your team. Hiring the right people determines future success. So it’s about finding the needle in the haystack for employers like Appwrite, and for you to be that needle, you need to shine brighter than the rest. +Finding the right team members is crucial for tech start-ups. When you are still building your company, there is little room for error, especially when building your team. Hiring the right people determines future success. So it’s about finding the needle in the haystack for employers like Appwrite, and for you to be that needle, you need to shine brighter than the rest. Now, this is not an unhealthy testimony to working day and night, every day, no fun, or any of that. On the contrary, we stand for healthy life balance and will force you to take leave if you like it or not. To stand out is to deliver quality work consistently, not quantity, to be eager to learn, receptive to feedback, and supportive of others. And if you missed this point, one thing is for sure: contributing to open source increases the chances of getting hired into a tech job. diff --git a/src/routes/changelog/(entries)/2024-03-01 b/src/routes/changelog/(entries)/2024-03-01.markdoc similarity index 88% rename from src/routes/changelog/(entries)/2024-03-01 rename to src/routes/changelog/(entries)/2024-03-01.markdoc index c0e3c71d7..e3d611c28 100644 --- a/src/routes/changelog/(entries)/2024-03-01 +++ b/src/routes/changelog/(entries)/2024-03-01.markdoc @@ -7,6 +7,6 @@ cover: /images/changelog/2024-03-01.png Previously, we completely reimagined Functions to be more flexible and innovative yet familiar to developers. Now, Appwrite expands and updates the runtime ecosystem available on Appwrite Cloud with Bun 1.0.29, Node 21, Ruby 3.3, Deno 1.40, PHP 8.3, Python 3.12, Kotlin 1.9, Java 18, Swift 5.9 and Dart 3.3 support. -{% arrow_link href="blog/post/announcing-more-and-updated-runtimes" %} +{% arrow_link href="/blog/post/announcing-more-and-updated-runtimes" %} Read the announcement to learn more {% /arrow_link %} diff --git a/src/routes/changelog/(entries)/2024-03-07.markdoc b/src/routes/changelog/(entries)/2024-03-07.markdoc new file mode 100644 index 000000000..cb1aaaec2 --- /dev/null +++ b/src/routes/changelog/(entries)/2024-03-07.markdoc @@ -0,0 +1,12 @@ +--- +layout: changelog +title: Appwrite API references now display the rate limits per endpoint. +date: 2024-03-07 +cover: /images/changelog/2024-03-07.png +--- + +Find them in [references documentation](/docs/references). + +{% arrow_link href="/docs/advanced/platform/rate-limits" %} +Learn about Rate limits +{% /arrow_link %} diff --git a/src/routes/changelog/(entries)/2024-03-08.markdoc b/src/routes/changelog/(entries)/2024-03-08.markdoc new file mode 100644 index 000000000..f2f46997b --- /dev/null +++ b/src/routes/changelog/(entries)/2024-03-08.markdoc @@ -0,0 +1,20 @@ +--- +layout: changelog +title: Appwrite 1.5 has been released to self hosted +date: 2024-03-08 +cover: /images/changelog/2024-03-08.png +--- + +Appwrite 1.5 has been released to self hosted. + +You can now build with +- Messaging +- Improved SSR support +- 2FA +- Enum SDK support +- OR and Contains queries +- New and updated runtimes + +{% arrow_link href="/blog/post/everything-new-with-appwrite-1.5" %} +Read the recap article to learn more +{% /arrow_link %} diff --git a/src/routes/docs/advanced/platform/billing/+page.markdoc b/src/routes/docs/advanced/platform/billing/+page.markdoc index 2ecd55960..210b29354 100644 --- a/src/routes/docs/advanced/platform/billing/+page.markdoc +++ b/src/routes/docs/advanced/platform/billing/+page.markdoc @@ -44,4 +44,21 @@ By default, an email alert will be sent at 75% of the budget cap. You can add up # Redeem credit {% #redeem-credit %} If you received a redeemable code for Appwrite Cloud credits, you can redeem them in the **Available credit** section. -When you redeem credit, the credit balance will be automatically applied to the next billing cycle. \ No newline at end of file +When you redeem credit, the credit balance will be automatically applied to the next billing cycle. + +# Recurring payments for Indian developers {% #recurring-payments-for-indian-developers %} + +The Reserve Bank of India (RBI) mandates additional security measures for recurring payments on **Indian cards**. +Appwrite is obligated to ask for verification before billing your card. +Appwrite asks for verification for up to $150 in case you use add-ons. +Confirming the verification will not charge your card. +When you are charged at the end of the billing period, +you will not be charged more than your monthly plan plus add-ons used. + +If you set a budget cap, the verification will remain at $150, but the budget cap will still be applied for your add-ons. +Again, you will not be charged when confirming the verification. +When you are charged at the end of the billing period, +you will not be charged more than your monthly plan plus add-ons used. + +If you need higher limits, [contact us](mailto:billing@appwrite.io). + diff --git a/src/routes/docs/advanced/self-hosting/+page.markdoc b/src/routes/docs/advanced/self-hosting/+page.markdoc index cd17499eb..fd2c85f85 100644 --- a/src/routes/docs/advanced/self-hosting/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/+page.markdoc @@ -35,7 +35,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.4.13 + appwrite/appwrite:1.5.1 ``` {% /tabsitem %} @@ -46,7 +46,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.4.13 + appwrite/appwrite:1.5.1 ``` ## Powershell ```powershell @@ -54,7 +54,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.4.13 + appwrite/appwrite:1.5.1 ``` {% /tabsitem %} {% /tabs %} diff --git a/src/routes/docs/advanced/self-hosting/update/+page.markdoc b/src/routes/docs/advanced/self-hosting/update/+page.markdoc index 7960d12fe..7be63ed75 100644 --- a/src/routes/docs/advanced/self-hosting/update/+page.markdoc +++ b/src/routes/docs/advanced/self-hosting/update/+page.markdoc @@ -35,7 +35,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="upgrade" \ - appwrite/appwrite:1.4.13 + appwrite/appwrite:1.5.1 ``` ## CMD @@ -45,7 +45,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="upgrade" ^ - appwrite/appwrite:1.4.13 + appwrite/appwrite:1.5.1 ``` ## PowerShell @@ -55,7 +55,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="upgrade" ` - appwrite/appwrite:1.4.13 + appwrite/appwrite:1.5.1 ``` This will pull the `docker-compose.yml` file for the new version and perform the installation. diff --git a/src/routes/docs/products/auth/tokens/+page.markdoc b/src/routes/docs/products/auth/tokens/+page.markdoc index 5eabac547..cbb69145b 100644 --- a/src/routes/docs/products/auth/tokens/+page.markdoc +++ b/src/routes/docs/products/auth/tokens/+page.markdoc @@ -4,7 +4,12 @@ title: Tokens description: What are tokens and how to use them in Appwrite --- -Tokens are short-lived secrets created by an that can be exchanged for session by a [Client SDK](/docs/sdks#client) to log in users. +Tokens are short-lived secrets created by an [Appwrite Server SDK](/docs/sdks#server) that can be exchanged for session by a [Client SDK](/docs/sdks#client) to log in users. +Some auth methods like [Magic URL login](/docs/products/auth/magic-url), +[Email OTP login](/docs/products/auth/email-otp), or [Phone (SMS) login](/docs/products/auth/phone-sms) already generate tokens. + +You can also create custom tokens using the [Create token](/docs/products/auth/custom-token) +endpoint of the [Users API](/docs/products/auth/users). This can be used to implement **custom authentication flows**. Tokens are created with the following properties: @@ -18,20 +23,16 @@ Tokens are created with the following properties: Many Appwrite authentication methods use a token-base flow to authenticate users. For token-based authentication methods, there are two high level steps to authenticate a user: -# Create a token {% #create-a-token %} +# Token login {% #token-login %} +You can find different usage of tokens in the Appwrite. -First, create a token for the user. - -Methods that create tokens include [Magic URL login](/docs/products/auth/magic-url), [Email OTP login](/docs/products/auth/email-otp), [Phone (SMS) login](/docs/products/auth/phone-sms), and [Custom token](/docs/products/auth/custom-token/#create-custom-token). - -These methods transfer the token `userId` and `secret` to the client, via a URL, email, SMS, or other method. The client then uses the token to create a session. - -Custom tokens can be created using the [Create token](/docs/references/cloud/server-nodejs/users#createToken) endpoint of the [Users API](/docs/products/auth/users). - -# Create a session using the token {% #create-session-using-token %} - -After the token is created, the client uses the token to create a session. The session is then used to authenticate the user for subsequent requests. - -To create a session, the client sends the token to the server using the [Create session](/docs/references/cloud/server-nodejs/account#createSession) endpoint of the [Account API](/docs/products/auth/users). The server then returns a session object. - -When the session is successfully created, the session is stored in a persistent manner and you can now do requests as authorized user from the application. +{% cards %} +{% cards_item href="/docs/products/auth/custom-token" title="Custom token login" %} +{% /cards_item %} +{% cards_item href="/docs/products/auth/email-otp" title="Email OTP login" %} +{% /cards_item %} +{% cards_item href="/docs/products/auth/magic-url" title="Email magic URL" %} +{% /cards_item %} +{% cards_item href="/docs/products/auth/phone-sms" title="Phone (SMS) OTP" %} +{% /cards_item %} +{% /cards %} diff --git a/src/routes/docs/products/auth/users/+page.markdoc b/src/routes/docs/products/auth/users/+page.markdoc index eba37ea58..ace697245 100644 --- a/src/routes/docs/products/auth/users/+page.markdoc +++ b/src/routes/docs/products/auth/users/+page.markdoc @@ -1,6 +1,6 @@ --- layout: article -title: Manage users +title: Users description: Manage user identities and profiles effectively with Appwrite. Dive into user management features, account settings, and user data customization --- diff --git a/src/routes/docs/products/functions/runtimes/+page.markdoc b/src/routes/docs/products/functions/runtimes/+page.markdoc index 17f12c3b3..2a54ab63c 100644 --- a/src/routes/docs/products/functions/runtimes/+page.markdoc +++ b/src/routes/docs/products/functions/runtimes/+page.markdoc @@ -22,9 +22,10 @@ Below is a list of available Functions runtimes. The Appwrite team continually a `node-18.0` `node-19.0` `node-20.0` +`node-21.0` * x86 / arm64 / armv7 / armv8 --- -* {% icon icon="bun" size="l" /%} +* {% icon icon="bun-sh" size="l" /%} * [Bun](https://hub.docker.com/r/openruntimes/bun/tags) * `bun-1.0` * x86 / arm64 @@ -34,6 +35,7 @@ Below is a list of available Functions runtimes. The Appwrite team continually a * `deno-1.21` `deno-1.24` `deno-1.35` +`deno-1.40` * x86 --- * {% icon icon="python" size="l" /%} @@ -53,6 +55,7 @@ Below is a list of available Functions runtimes. The Appwrite team continually a `dart-2.18` `dart-3.0` `dart-3.1` +`dart-3.3` * x86 / arm64 / armv7 / armv8 --- * {% icon icon="php" size="l" /%} @@ -60,6 +63,7 @@ Below is a list of available Functions runtimes. The Appwrite team continually a * `php-8.0` `php-8.1` `php-8.2` +`php-8.3` * x86 / arm64 / armv7 / armv8 --- * {% icon icon="ruby" size="l" /%} @@ -67,6 +71,7 @@ Below is a list of available Functions runtimes. The Appwrite team continually a * `ruby-3.0` `ruby-3.1` `ruby-3.2` +`ruby-3.3` * x86 / arm64 / armv7 / armv8 --- * {% icon icon="dotnet" size="l" /%} @@ -82,18 +87,21 @@ Below is a list of available Functions runtimes. The Appwrite team continually a `java-11.0` `java-17.0` `java-18.0` +`java-21.0` * x86 / arm64 / armv7 / armv8 --- * {% icon icon="swift" size="l" /%} * [Swift](https://hub.docker.com/r/openruntimes/swift/tags) * `swift-5.5` `swift-5.8` +`swift-5.9` * x86 / arm64 / armv7 / armv8 --- * {% icon icon="kotlin" size="l" /%} * [Kotlin](https://hub.docker.com/r/openruntimes/kotlin/tags) * `kotlin-1.6` `kotlin-1.8` +`kotlin-1.9` * x86 / arm64 / armv7 / armv8 --- * {% icon icon="cpp" size="l" /%} @@ -114,4 +122,4 @@ While still in beta, Appwrite Cloud has limited support for Cloud runtimes. As w - `ruby-3.0` - `python-3.9` - `python-3.12` -- `dart-2.17` \ No newline at end of file +- `dart-2.17` diff --git a/src/routes/docs/products/messaging/apns/+page.markdoc b/src/routes/docs/products/messaging/apns/+page.markdoc index 70dbc0ad3..4c0c6c207 100644 --- a/src/routes/docs/products/messaging/apns/+page.markdoc +++ b/src/routes/docs/products/messaging/apns/+page.markdoc @@ -88,7 +88,7 @@ Add push notification capability to your app by clicking your root-level app in Push notification requires special handling on the client side. Follow the [Send push notification](/docs/products/messaging/send-push-notifications) flow to test your provider. {% /section %} -{% section #manage-provider step=4 title="Manage provider" %} +{% section #manage-provider step=5 title="Manage provider" %} {% tabs %} {% tabsitem #console title="Console" %} You can update or delete a provider in the Appwrite Console. @@ -116,7 +116,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateAPNSProvider( +const provider = await messaging.updateAPNSProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -125,12 +125,6 @@ const promise = messaging.updateAPNSProvider( '[TEAM_ID]', // teamId (optional) '[BUNDLE_ID]' // bundleId (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -146,7 +140,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateAPNSProvider( +const provider = await messaging.updateAPNSProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -155,12 +149,6 @@ const promise = messaging.updateAPNSProvider( '[TEAM_ID]', // teamId (optional) '[BUNDLE_ID]' // bundleId (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php ') // Your secret API key ; -const promise = messaging.createEmail('', '', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const message = await messaging.createEmail('', '', ''); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -122,13 +116,7 @@ client .setKey('') // Your secret API key ; -let promise = messaging.createEmail('', '', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const message - await messaging.createEmail('', '', ''); ``` ```php createPush( color: '[COLOR]', // optional tag: '[TAG]', // optional badge: '[BADGE]', // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '' // optional ); ``` @@ -365,7 +352,7 @@ result = messaging.create_push( color = '[COLOR]', # optional tag = '[TAG]', # optional badge = '[BADGE]', # optional - status = 'draft', # optional + draft = True, # optional scheduled_at = '' # optional ) ``` @@ -395,7 +382,7 @@ response = messaging.create_push( color: '[COLOR]', # optional tag: '[TAG]', # optional badge: '[BADGE]', # optional - status: 'draft', # optional + draft: true, # optional scheduled_at: '' # optional ) @@ -416,22 +403,24 @@ var messaging = new Messaging(client); Message result = await messaging.CreatePush( messageId: "[MESSAGE_ID]", title: "[TITLE]", - body: "[BODY]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - data: [object] // optional - action: "[ACTION]" // optional - icon: "[ICON]" // optional - sound: "[SOUND]" // optional - color: "[COLOR]" // optional - tag: "[TAG]" // optional - badge: "[BADGE]" // optional - status: "draft" // optional + body: "[BODY]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + data: [object] // optional + action: "[ACTION]" // optional + icon: "[ICON]" // optional + sound: "[SOUND]" // optional + color: "[COLOR]" // optional + tag: "[TAG]" // optional + badge: "[BADGE]" // optional + draft: true // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -457,7 +446,7 @@ void main() { // Init SDK color: '[COLOR]', // optional tag: '[TAG]', // optional badge: '[BADGE]', // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '', // optional ); @@ -495,7 +484,7 @@ messaging.createPush( "[COLOR]", // color (optional) "[TAG]", // tag (optional) "[BADGE]", // badge (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -533,7 +522,7 @@ messaging.createPush( "[COLOR]", // color (optional) "[TAG]", // tag (optional) "[BADGE]", // badge (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -569,7 +558,7 @@ let message = try await messaging.createPush( color: "[COLOR]", // optional tag: "[TAG]", // optional badge: "[BADGE]", // optional - status: "draft", // optional + draft: true, // optional scheduledAt: "" // optional ) ``` @@ -596,7 +585,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createEmail( +const message - await messaging.createEmail( '[MESSAGE_ID]', // messageId '[SUBJECT]', // subject '[CONTENT]', // content @@ -605,16 +594,10 @@ const promise = messaging.createEmail( [], // targets (optional) [], // cc (optional) [], // bcc (optional) - 'draft', // status (optional) + true, // draft (optional) false, // html (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -630,7 +613,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createEmail( +const message - await messaging.createEmail( '[MESSAGE_ID]', // messageId '[SUBJECT]', // subject '[CONTENT]', // content @@ -639,16 +622,10 @@ const promise = messaging.createEmail( [], // targets (optional) [], // cc (optional) [], // bcc (optional) - 'draft', // status (optional) + true, // draft (optional) false, // html (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php createEmail( targets: [], // optional cc: [], // optional bcc: [], // optional - status: 'draft', // optional + draft: true, // optional html: false, // optional scheduledAt: '' // optional ); @@ -703,7 +680,7 @@ result = messaging.create_email( targets = [], # optional cc = [], # optional bcc = [], # optional - status = 'draft', # optional + draft = True, # optional html = False, # optional scheduled_at = '' # optional ) @@ -729,7 +706,7 @@ response = messaging.create_email( targets: [], # optional cc: [], # optional bcc: [], # optional - status: 'draft', # optional + draft: true, # optional html: false, # optional scheduled_at: '' # optional ) @@ -751,18 +728,20 @@ var messaging = new Messaging(client); Message result = await messaging.CreateEmail( messageId: "[MESSAGE_ID]", subject: "[SUBJECT]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - cc: new List {} // optional - bcc: new List {} // optional - status: "draft" // optional - html: false // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + cc: new List {} // optional + bcc: new List {} // optional + draft: true // optional + html: false // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -783,7 +762,7 @@ void main() { // Init SDK targets: [], // optional cc: [], // optional bcc: [], // optional - status: 'draft', // optional + draft: true, // optional html: false, // optional scheduledAt: '', // optional ); @@ -817,7 +796,7 @@ messaging.createEmail( listOf(), // targets (optional) listOf(), // cc (optional) listOf(), // bcc (optional) - "draft", // status (optional) + true, // draft (optional) false, // html (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { @@ -851,7 +830,7 @@ messaging.createEmail( listOf(), // targets (optional) listOf(), // cc (optional) listOf(), // bcc (optional) - "draft", // status (optional) + true, // draft (optional) false, // html (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { @@ -883,7 +862,7 @@ let message = try await messaging.createEmail( targets: [], // optional cc: [], // optional bcc: [], // optional - status: "draft", // optional + draft: true, // optional html: xfalse, // optional scheduledAt: "" // optional ) @@ -911,21 +890,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createSMS( +const message = await messaging.createSMS( '[MESSAGE_ID]', // messageId '[CONTENT]', // content [], // topics (optional) [], // users (optional) [], // targets (optional) - 'draft', // status (optional) + true, // draft (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -941,21 +914,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createSMS( +const message = await messaging.createSMS( '[MESSAGE_ID]', // messageId '[CONTENT]', // content [], // topics (optional) [], // users (optional) [], // targets (optional) - 'draft', // status (optional) + true, // draft (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '' // optional ); ``` @@ -1003,7 +970,7 @@ result = messaging.create_sms( topics = [], # optional users = [], # optional targets = [], # optional - status = 'draft', # optional + draft = True, # optional scheduled_at = '' # optional ) ``` @@ -1025,7 +992,7 @@ response = messaging.create_sms( topics: [], # optional users: [], # optional targets: [], # optional - status: 'draft', # optional + draft: true, # optional scheduled_at: '' # optional ) @@ -1045,15 +1012,17 @@ var messaging = new Messaging(client); Message result = await messaging.CreateSMS( messageId: "[MESSAGE_ID]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - status: "draft" // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + draft: true // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -1071,7 +1040,7 @@ void main() { // Init SDK topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '', // optional ); @@ -1101,7 +1070,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -1131,7 +1100,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -1159,7 +1128,7 @@ let message = try await messaging.createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: "draft", // optional + draft: true, // optional scheduledAt: "" // optional ) ``` diff --git a/src/routes/docs/products/messaging/msg91/+page.markdoc b/src/routes/docs/products/messaging/msg91/+page.markdoc index 6c85e3ed8..8342a2f23 100644 --- a/src/routes/docs/products/messaging/msg91/+page.markdoc +++ b/src/routes/docs/products/messaging/msg91/+page.markdoc @@ -81,21 +81,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createSMS( +const message = await messaging.createSMS( '[MESSAGE_ID]', // messageId '[CONTENT]', // content [], // topics (optional) [], // users (optional) [], // targets (optional) - 'draft', // status (optional) + true, // draft (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -111,21 +105,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createSMS( +const message = await messaging.createSMS( '[MESSAGE_ID]', // messageId '[CONTENT]', // content [], // topics (optional) [], // users (optional) [], // targets (optional) - 'draft', // status (optional) + true, // draft (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '' // optional ); ``` @@ -173,7 +161,7 @@ result = messaging.create_sms( topics = [], # optional users = [], # optional targets = [], # optional - status = 'draft', # optional + draft = True, # optional scheduled_at = '' # optional ) ``` @@ -195,7 +183,7 @@ response = messaging.create_sms( topics: [], # optional users: [], # optional targets: [], # optional - status: 'draft', # optional + draft: true, # optional scheduled_at: '' # optional ) @@ -215,15 +203,17 @@ var messaging = new Messaging(client); Message result = await messaging.CreateSMS( messageId: "[MESSAGE_ID]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - status: "draft" // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + draft: true // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -241,7 +231,7 @@ void main() { // Init SDK topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '', // optional ); @@ -271,7 +261,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -301,7 +291,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -329,7 +319,7 @@ let message = try await messaging.createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: "draft", // optional + draft: true, // optional scheduledAt: "" // optional ) ``` @@ -367,7 +357,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateMsg91Provider( +const message = await messaging.updateMsg91Provider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -375,12 +365,6 @@ const promise = messaging.updateMsg91Provider( '[AUTH_KEY]', // authKey (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -396,7 +380,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateMsg91Provider( +const message = await messaging.updateMsg91Provider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -404,12 +388,6 @@ const promise = messaging.updateMsg91Provider( '[AUTH_KEY]', // authKey (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php ', // userId + '', // targetId + sdk.MessagingProviderType.Email, // providerType + '', // identifier + '', // providerId (optional) + '' // name (optional) +); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; -// Init SDK -let client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setJWT('eyJhbVCJ9.eyJ...'); // Your secret JSON Web Token -let messaging = new sdk.Messaging(client); +const users = new sdk.Users(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token -; - -const promise = messaging.createSubscriber( - '[TOPIC_ID]', // topicId - '[SUBSCRIBER_ID]', // subscriberId - '[TARGET_ID]' // targetId - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const target = await users.createTarget( + '', // userId + '', // targetId + sdk.MessagingProviderType.Email, // providerType + '', // identifier + '', // providerId (optional) + '' // name (optional) +); ``` ```php setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key -$client - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token -; +$users = new Users($client); -$messaging = new Messaging($client); - -$result = $messaging->createSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', - targetId: '[TARGET_ID]' +$target = $users->createTarget( + userId: '', + targetId: '', + providerType: MessagingProviderType::EMAIL(), + identifier: '', + providerId: '', // optional + name: '' // optional ); ``` ```python from appwrite.client import Client -from appwrite.services.messaging import Messaging +from appwrite.enums import MessagingProviderType client = Client() +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -) +users = Users(client) -messaging = Messaging(client) - -result = messaging.create_subscriber( - topic_id = '[TOPIC_ID]', - subscriber_id = '[SUBSCRIBER_ID]', - target_id = '[TARGET_ID]' +target = users.create_target( + user_id = '', + target_id = '', + provider_type = MessagingProviderType.EMAIL, + identifier = '', + provider_id = '', # optional + name = '' # optional ) ``` ```ruby require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -messaging = Messaging.new(client) +users = Users.new(client) -response = messaging.create_subscriber( - topic_id: '[TOPIC_ID]', - subscriber_id: '[SUBSCRIBER_ID]', - target_id: '[TARGET_ID]' +target = users.create_target( + user_id: '', + target_id: '', + provider_type: MessagingProviderType::EMAIL, + identifier: '', + provider_id: '', # optional + name: '' # optional +) + +puts target.inspect +``` +```csharp +using Appwrite; +using Appwrite.Services; +using Appwrite.Models; +using Appwrite.Enums; + +Client client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +Users users = new Users(client); + +Target target = await users.CreateTarget( + userId: "", + targetId: "", + providerType: MessagingProviderType.Email, + identifier: "", + providerId: "", // optional + name: "" // optional +); +``` +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; + +Client client = Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key + +Users users = Users(client); + +final target = await users.createTarget( + userId: '', + targetId: '', + providerType: MessagingProviderType.email, + identifier: '', + providerId: '', // (optional) + name: '', // (optional) +); + +``` +```kotlin +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users +import io.appwrite.enums.MessagingProviderType + +val client = Client() + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + +val users = Users(client) + +val target = users.createTarget( + userId = "", + targetId = "", + providerType = MessagingProviderType.EMAIL, + identifier = "", + providerId = "", // optional + name = "" // optional +) + +``` +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Users; +import io.appwrite.enums.MessagingProviderType; + +Client client = new Client() + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +Users users = new Users(client); + +users.createTarget( + "", // userId + "", // targetId + MessagingProviderType.EMAIL, // providerType + "", // identifier + "", // providerId (optional) + "", // name (optional) + new CoroutineCallback<>((target, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(target); + }) +); +``` +```swift +import Appwrite +import AppwriteEnums + +let client = Client() + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + +let users = Users(client) + +let target = try await users.createTarget( + userId: "", + targetId: "", + providerType: .email, + identifier: "", + providerId: "", // optional + name: "" // optional +) +``` +{% /multicode %} +{% multicode %} +```js +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key + +const users = new sdk.Users(client); + +const response = await users.createTarget( + '', // userId + '', // targetId + sdk.MessagingProviderType.Phone, // providerType + '', // identifier + '', // providerId (optional) + '' // name (optional) +); +``` +```deno +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setJWT('eyJhbVCJ9.eyJ...'); // Your secret JSON Web Token + +const users = new sdk.Users(client); + +const response = await users.createTarget( + '', // userId + '', // targetId + sdk.MessagingProviderType.Phone, // providerType + '', // identifier + '', // providerId (optional) + '' // name (optional) +); +``` +```php +setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key + +$users = new Users($client); + +$result = $users->createTarget( + userId: '', + targetId: '', + providerType: MessagingProviderType::PHONE(), + identifier: '', + providerId: '', // optional + name: '' // optional +); +``` +```python +from appwrite.client import Client +from appwrite.enums import MessagingProviderType + +client = Client() +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +users = Users(client) + +result = users.create_target( + user_id = '', + target_id = '', + provider_type = MessagingProviderType.PHONE, + identifier = '', + provider_id = '', # optional + name = '' # optional +) +``` +```ruby +require 'appwrite' + +include Appwrite +include Appwrite::Enums + +client = Client.new + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +users = Users.new(client) + +response = users.create_target( + user_id: '', + target_id: '', + provider_type: MessagingProviderType::EMAIL, + identifier: '', + provider_id: '', # optional + name: '' # optional ) puts response.inspect @@ -160,88 +375,89 @@ puts response.inspect using Appwrite; using Appwrite.Services; using Appwrite.Models; +using Appwrite.Enums; -var client = new Client() - .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("5df5acd0d48c2") // Your project ID - .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +Client client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -var messaging = new Messaging(client); +Users users = new Users(client); -Subscriber result = await messaging.CreateSubscriber( - topicId: "[TOPIC_ID]", - subscriberId: "[SUBSCRIBER_ID]", - targetId: "[TARGET_ID]"); +Target result = await users.CreateTarget( + userId: "", + targetId: "", + providerType: MessagingProviderType.PHONE, + identifier: "", + providerId: "", // optional + name: "" // optional +); ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; -void main() { // Init SDK - Client client = Client(); - Messaging messaging = Messaging(client); +Client client = Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key - client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token - ; +Users users = Users(client); - Future result = messaging.createSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', - targetId: '[TARGET_ID]', - ); +Target result = await users.createTarget( + userId: '', + targetId: '', + providerType: MessagingProviderType.PHONE, + identifier: '', + providerId: '', // (optional) + name: '', // (optional) +); - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} ``` ```kotlin -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Messaging; +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users +import io.appwrite.enums.MessagingProviderType -Client client = new Client() +val client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -Messaging messaging = new Messaging(client); +val users = Users(client) -messaging.createSubscriber( - "[TOPIC_ID]", // topicId - "[SUBSCRIBER_ID]", // subscriberId - "[TARGET_ID]" // targetId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } +val response = users.createTarget( + userId = "", + targetId = "", + providerType = MessagingProviderType.PHONE, + identifier = "", + providerId = "", // optional + name = "" // optional +) - System.out.println(result); - }) -); ``` ```java import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Messaging; +import io.appwrite.services.Users; +import io.appwrite.enums.MessagingProviderType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Messaging messaging = new Messaging(client); +Users users = new Users(client); -messaging.createSubscriber( - "[TOPIC_ID]", // topicId - "[SUBSCRIBER_ID]", // subscriberId - "[TARGET_ID]" // targetId +users.createTarget( + "", // userId + "", // targetId + MessagingProviderType.PHONE, // providerType + "", // identifier + "", // providerId (optional) + "", // name (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); @@ -254,18 +470,22 @@ messaging.createSubscriber( ``` ```swift import Appwrite +import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -let messaging = Messaging(client) +let users = Users(client) -let subscriber = try await messaging.createSubscriber( - topicId: "[TOPIC_ID]", - subscriberId: "[SUBSCRIBER_ID]", - targetId: "[TARGET_ID]" +let target = try await users.createTarget( + userId: "", + targetId: "", + providerType: .phone, + identifier: "", + providerId: "", // optional + name: "" // optional ) ``` {% /multicode %} @@ -297,16 +517,10 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createTopic( +const topic = await messaging.createTopic( '[TOPIC_ID]', // topicId '[NAME]' // name ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -322,16 +536,10 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createTopic( +const topic = await messaging.createTopic( '[TOPIC_ID]', // topicId '[NAME]' // name ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php createEmail( targets: [], // optional cc: [], // optional bcc: [], // optional - status: 'processing', // optional + draft: false, // optional html: false, // optional scheduledAt: '' // optional ); @@ -626,7 +824,7 @@ result = messaging.create_email( targets = [], # optional cc = [], # optional bcc = [], # optional - status = 'processing', # optional + draft = False, # optional html = False, # optional scheduled_at = '' # optional ) @@ -652,7 +850,7 @@ response = messaging.create_email( targets: [], # optional cc: [], # optional bcc: [], # optional - status: 'processing', # optional + draft: false, # optional html: false, # optional scheduled_at: '' # optional ) @@ -674,18 +872,20 @@ var messaging = new Messaging(client); Message result = await messaging.CreateEmail( messageId: "[MESSAGE_ID]", subject: "[SUBJECT]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - cc: new List {} // optional - bcc: new List {} // optional - status: "processing" // optional - html: false // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + cc: new List {} // optional + bcc: new List {} // optional + draft: false // optional + html: false // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -706,7 +906,7 @@ void main() { // Init SDK targets: [], // optional cc: [], // optional bcc: [], // optional - status: 'processing', // optional + draft: false, // optional html: false, // optional scheduledAt: '', // optional ); @@ -740,7 +940,7 @@ messaging.createEmail( listOf(), // targets (optional) listOf(), // cc (optional) listOf(), // bcc (optional) - "processing", // status (optional) + false, // draft (optional) false, // html (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { @@ -759,24 +959,24 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Messaging messaging = new Messaging(client); messaging.createEmail( - "[MESSAGE_ID]", // messageId - "[SUBJECT]", // subject - "[CONTENT]", // content - listOf(), // topics (optional) - listOf(), // users (optional) - listOf(), // targets (optional) - listOf(), // cc (optional) - listOf(), // bcc (optional) - "processing", // status (optional) - false, // html (optional) - "" // scheduledAt (optional) + "[MESSAGE_ID]", // messageId + "[SUBJECT]", // subject + "[CONTENT]", // content + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + listOf(), // cc (optional) + listOf(), // bcc (optional) + false, // draft (optional) + false, // html (optional) + "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); @@ -806,7 +1006,7 @@ let message = try await messaging.createEmail( targets: [], // optional cc: [], // optional bcc: [], // optional - status: "processing", // optional + draft: false, // optional html: xfalse, // optional scheduledAt: "" // optional ) @@ -827,29 +1027,23 @@ const messaging = new sdk.Messaging(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createEmail( - '[MESSAGE_ID]', // messageId - '[SUBJECT]', // subject - '[CONTENT]', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - 'scheduled', // status (optional) - false, // html (optional) - '2025-02-13T22:01:00+0000' // scheduledAt (optional) +const message - await messaging.createEmail( + '[MESSAGE_ID]', // messageId + '[SUBJECT]', // subject + '[CONTENT]', // content + [], // topics (optional) + [], // users (optional) + [], // targets (optional) + [], // cc (optional) + [], // bcc (optional) + false, // draft (optional) + false, // html (optional) + '2025-02-13T22:01:00+0000' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -861,29 +1055,23 @@ let messaging = new sdk.Messaging(client); client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createEmail( - '[MESSAGE_ID]', // messageId - '[SUBJECT]', // subject - '[CONTENT]', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - [], // cc (optional) - [], // bcc (optional) - 'scheduled', // status (optional) - false, // html (optional) - '2025-02-13T22:01:00+0000' // scheduledAt (optional) +const message - await messaging.createEmail( + '[MESSAGE_ID]', // messageId + '[SUBJECT]', // subject + '[CONTENT]', // content + [], // topics (optional) + [], // users (optional) + [], // targets (optional) + [], // cc (optional) + [], // bcc (optional) + false, // draft (optional) + false, // html (optional) + '2025-02-13T22:01:00+0000' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key + ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $messaging = new Messaging($client); -$result = $messaging->createEmail( - messageId: '[MESSAGE_ID]', - subject: '[SUBJECT]', - content: '[CONTENT]', - topics: [], // optional - users: [], // optional - targets: [], // optional - cc: [], // optional - bcc: [], // optional - status: 'scheduled', // optional - html: false, // optional - scheduledAt: '2025-02-13T22:01:00+0000']// optional// +$result = $messaging->createEmail( + messageId: '[MESSAGE_ID]', + subject: '[SUBJECT]', + content: '[CONTENT]', + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '2025-02-13T22:01:00+0000' ); ``` ```python @@ -923,24 +1111,24 @@ client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) messaging = Messaging(client) -result = messaging.create_email( - message_id = '[MESSAGE_ID]', - subject = '[SUBJECT]', - content = '[CONTENT]', - topics = [], # optional - users = [], # optional - targets = [], # optional - cc = [], # optional - bcc = [], # optional - status = 'scheduled', # optional - html = False, # optional - scheduled_at = '2025-02-13T22:01:00+0000' # optional +result = messaging.create_email( + message_id = '[MESSAGE_ID]', + subject = '[SUBJECT]', + content = '[CONTENT]', + topics = [], # optional + users = [], # optional + targets = [], # optional + cc = [], # optional + bcc = [], # optional + draft = False, # optional + html = False, # optional + scheduled_at = '2025-02-13T22:01:00+0000' ) ``` ```ruby @@ -950,23 +1138,23 @@ include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging.new(client) response = messaging.create_email( - message_id: '[MESSAGE_ID]', - subject: '[SUBJECT]', - content: '[CONTENT]', - topics: [], # optional - users: [], # optional - targets: [], # optional - cc: [], # optional - bcc: [], # optional - status: 'scheduled', # optional - html: false, # optional - scheduled_at: '2025-02-13T22:01:00+0000' # optional + message_id: '[MESSAGE_ID]', + subject: '[SUBJECT]', + content: '[CONTENT]', + topics: [], # optional + users: [], # optional + targets: [], # optional + cc: [], # optional + bcc: [], # optional + draft: false, # optional + html: false, # optional + scheduled_at: '2025-02-13T22:01:00+0000' ) puts response.inspect @@ -978,26 +1166,28 @@ using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("5df5acd0d48c2") // Your project ID - .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2");// Your secret API key var messaging = new Messaging(client); Message result = await messaging.CreateEmail( messageId: "[MESSAGE_ID]", subject: "[SUBJECT]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - cc: new List {} // optional - bcc: new List {} // optional - status: "scheduled" // optional - html: false // optional - scheduledAt: "2025-02-13T22:01:00+0000"); // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + cc: new List {} // optional + bcc: new List {} // optional + draft: false // optional + html: false // optional + scheduledAt: "2025-02-13T22:01:00+0000"); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -1005,22 +1195,22 @@ void main() { // Init SDK client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = messaging.createEmail( messageId: '[MESSAGE_ID]', subject: '[SUBJECT]', content: '[CONTENT]', - topics: [], // optional - users: [], // optional - targets: [], // optional - cc: [], // optional - bcc: [], // optional - status: 'scheduled', // optional - html: false, // optional - scheduledAt: '2025-02-13T22:01:00+0000', // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + draft: false, // optional + html: false, // optional + scheduledAt: '2025-02-13T22:01:00+0000', ); result @@ -1044,17 +1234,17 @@ Client client = new Client() Messaging messaging = new Messaging(client); messaging.createEmail( - "[MESSAGE_ID]", // messageId - "[SUBJECT]", // subject - "[CONTENT]", // content - listOf(), // topics (optional) - listOf(), // users (optional) - listOf(), // targets (optional) - listOf(), // cc (optional) - listOf(), // bcc (optional) - "scheduled", // status (optional) - false, // html (optional) - "2025-02-13T22:01:00+0000" // scheduledAt (optional) + "[MESSAGE_ID]", // messageId + "[SUBJECT]", // subject + "[CONTENT]", // content + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + listOf(), // cc (optional) + listOf(), // bcc (optional) + false, // draft (optional) + false, // html (optional) + "2025-02-13T22:01:00+0000" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); @@ -1072,23 +1262,23 @@ import io.appwrite.services.Messaging; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2");// Your secret API key Messaging messaging = new Messaging(client); messaging.createEmail( - "[MESSAGE_ID]", // messageId - "[SUBJECT]", // subject - "[CONTENT]", // content - listOf(), // topics (optional) - listOf(), // users (optional) - listOf(), // targets (optional) - listOf(), // cc (optional) - listOf(), // bcc (optional) - "scheduled", // status (optional) - false, // html (optional) - "2025-02-13T22:01:00+0000" // scheduledAt (optional) + "[MESSAGE_ID]", // messageId + "[SUBJECT]", // subject + "[CONTENT]", // content + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + listOf(), // cc (optional) + listOf(), // bcc (optional) + false, // draft (optional) + false, // html (optional) + "2025-02-13T22:01:00+0000" new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); @@ -1104,8 +1294,8 @@ import Appwrite let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let messaging = Messaging(client) @@ -1113,14 +1303,14 @@ let message = try await messaging.createEmail( messageId: "[MESSAGE_ID]", subject: "[SUBJECT]", content: "[CONTENT]", - topics: [], // optional - users: [], // optional - targets: [], // optional - cc: [], // optional - bcc: [], // optional - status: "scheduled", // optional - html: xfalse, // optional - scheduledAt: "2025-02-13T22:01:00+0000" // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + cc: [], // optional + bcc: [], // optional + draft: false, // optional + html: xfalse, // optional + scheduledAt: "2025-02-13T22:01:00+0000" ) ``` {% /multicode %} diff --git a/src/routes/docs/products/messaging/send-push-notifications/+page.markdoc b/src/routes/docs/products/messaging/send-push-notifications/+page.markdoc index 8ef5ce1f4..d4255d014 100644 --- a/src/routes/docs/products/messaging/send-push-notifications/+page.markdoc +++ b/src/routes/docs/products/messaging/send-push-notifications/+page.markdoc @@ -516,7 +516,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createPush( +const messaging = await messaging.createPush( '[MESSAGE_ID]', // messageId '[TITLE]', // title '[BODY]', // body @@ -530,15 +530,9 @@ const promise = messaging.createPush( '[COLOR]', // color (optional) '[TAG]', // tag (optional) '[BADGE]', // badge (optional) - 'draft', // status (optional) + false, // draft (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -554,7 +548,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createPush( +const messaging = await messaging.createPush( '[MESSAGE_ID]', // messageId '[TITLE]', // title '[BODY]', // body @@ -568,15 +562,9 @@ const promise = messaging.createPush( '[COLOR]', // color (optional) '[TAG]', // tag (optional) '[BADGE]', // badge (optional) - 'draft', // status (optional) + false, // draft (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php createPush( color: '[COLOR]', // optional tag: '[TAG]', // optional badge: '[BADGE]', // optional - status: 'draft', // optional + draft: false, // optional scheduledAt: '' // optional ); ``` @@ -640,7 +628,7 @@ result = messaging.create_push( color = '[COLOR]', # optional tag = '[TAG]', # optional badge = '[BADGE]', # optional - status = 'draft', # optional + draft = False, # optional scheduled_at = '' # optional ) ``` @@ -670,7 +658,7 @@ response = messaging.create_push( color: '[COLOR]', # optional tag: '[TAG]', # optional badge: '[BADGE]', # optional - status: 'draft', # optional + draft: false, # optional scheduled_at: '' # optional ) @@ -691,22 +679,24 @@ var messaging = new Messaging(client); Message result = await messaging.CreatePush( messageId: "[MESSAGE_ID]", title: "[TITLE]", - body: "[BODY]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - data: [object] // optional - action: "[ACTION]" // optional - icon: "[ICON]" // optional - sound: "[SOUND]" // optional - color: "[COLOR]" // optional - tag: "[TAG]" // optional - badge: "[BADGE]" // optional - status: "draft" // optional + body: "[BODY]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + data: [object] // optional + action: "[ACTION]" // optional + icon: "[ICON]" // optional + sound: "[SOUND]" // optional + color: "[COLOR]" // optional + tag: "[TAG]" // optional + badge: "[BADGE]" // optional + draft: false // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -732,7 +722,7 @@ void main() { // Init SDK color: '[COLOR]', // optional tag: '[TAG]', // optional badge: '[BADGE]', // optional - status: 'draft', // optional + draft: false, // optional scheduledAt: '', // optional ); @@ -769,7 +759,7 @@ val response = messaging.createPush( color = "[COLOR]", // optional tag = "[TAG]", // optional badge = "[BADGE]", // optional - status = "draft", // optional + draft = false, // optional scheduledAt = "" // optional ) ``` @@ -799,7 +789,7 @@ messaging.createPush( "[COLOR]", // color (optional) "[TAG]", // tag (optional) "[BADGE]", // badge (optional) - "draft", // status (optional) + false, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -835,7 +825,7 @@ let message = try await messaging.createPush( color: "[COLOR]", // optional tag: "[TAG]", // optional badge: "[BADGE]", // optional - status: "draft", // optional + draft: false, // optional scheduledAt: "" // optional ) ``` diff --git a/src/routes/docs/products/messaging/send-sms-messages/+page.markdoc b/src/routes/docs/products/messaging/send-sms-messages/+page.markdoc index 6d8800f23..cb092e245 100644 --- a/src/routes/docs/products/messaging/send-sms-messages/+page.markdoc +++ b/src/routes/docs/products/messaging/send-sms-messages/+page.markdoc @@ -54,227 +54,223 @@ You can also implement forms in your app to collect contact information and add ```js const sdk = require('node-appwrite'); -// Init SDK -const client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key -const messaging = new sdk.Messaging(client); +const users = new sdk.Users(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token -; - -const promise = messaging.createSubscriber( - '[TOPIC_ID]', // topicId - '[SUBSCRIBER_ID]', // subscriberId - '[TARGET_ID]' // targetId - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const target = await users.createTarget( + '', // userId + '', // targetId + sdk.MessagingProviderType.Phone, // providerType + '', // identifier + '', // providerId (optional) + '' // name (optional) +); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; -// Init SDK -let client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setJWT('eyJhbVCJ9.eyJ...'); // Your secret JSON Web Token -let messaging = new sdk.Messaging(client); +const users = new sdk.Users(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token -; - -const promise = messaging.createSubscriber( - '[TOPIC_ID]', // topicId - '[SUBSCRIBER_ID]', // subscriberId - '[TARGET_ID]' // targetId - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const target = await users.createTarget( + '', // userId + '', // targetId + sdk.MessagingProviderType.Phone, // providerType + '', // identifier + '', // providerId (optional) + '' // name (optional) +); ``` ```php setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key -$client - ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token -; +$users = new Users($client); -$messaging = new Messaging($client); - -$result = $messaging->createSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', - targetId: '[TARGET_ID]' +$target = $users->createTarget( + userId: '', + targetId: '', + providerType: MessagingProviderType::EMAIL(), + identifier: '', + providerId: '', // optional + name: '' // optional ); ``` ```python from appwrite.client import Client -from appwrite.services.messaging import Messaging +from appwrite.enums import MessagingProviderType client = Client() +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -) +users = Users(client) -messaging = Messaging(client) - -result = messaging.create_subscriber( - topic_id = '[TOPIC_ID]', - subscriber_id = '[SUBSCRIBER_ID]', - target_id = '[TARGET_ID]' +target = users.create_target( + user_id = '', + target_id = '', + provider_type = MessagingProviderType.PHONE, + identifier = '', + provider_id = '', # optional + name = '' # optional ) ``` ```ruby require 'appwrite' include Appwrite +include Appwrite::Enums client = Client.new - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -messaging = Messaging.new(client) +users = Users.new(client) -response = messaging.create_subscriber( - topic_id: '[TOPIC_ID]', - subscriber_id: '[SUBSCRIBER_ID]', - target_id: '[TARGET_ID]' +target = users.create_target( + user_id: '', + target_id: '', + provider_type: MessagingProviderType::EMAIL, + identifier: '', + provider_id: '', # optional + name: '' # optional ) -puts response.inspect +puts target.inspect ``` ```csharp using Appwrite; using Appwrite.Services; using Appwrite.Models; +using Appwrite.Enums; -var client = new Client() - .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("5df5acd0d48c2") // Your project ID - .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +Client client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -var messaging = new Messaging(client); +Users users = new Users(client); -Subscriber result = await messaging.CreateSubscriber( - topicId: "[TOPIC_ID]", - subscriberId: "[SUBSCRIBER_ID]", - targetId: "[TARGET_ID]"); +Target target = await users.CreateTarget( + userId: "", + targetId: "", + providerType: MessagingProviderType.Phone, + identifier: "", + providerId: "", // optional + name: "" // optional +); ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; -void main() { // Init SDK - Client client = Client(); - Messaging messaging = Messaging(client); +Client client = Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key - client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token - ; +Users users = Users(client); - Future result = messaging.createSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', - targetId: '[TARGET_ID]', - ); +Target target = await users.createTarget( + userId: '', + targetId: '', + providerType: MessagingProviderType.phone, + identifier: '', + providerId: '', // (optional) + name: '', // (optional) +); - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} ``` ```kotlin -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Messaging; +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Users +import io.appwrite.enums.MessagingProviderType -Client client = new Client() +val client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -Messaging messaging = new Messaging(client); +val users = Users(client) -messaging.createSubscriber( - "[TOPIC_ID]", // topicId - "[SUBSCRIBER_ID]", // subscriberId - "[TARGET_ID]" // targetId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } +val target = users.createTarget( + userId = "", + targetId = "", + providerType = MessagingProviderType.PHONE, + identifier = "", + providerId = "", // optional + name = "" // optional +) - System.out.println(result); - }) -); ``` ```java import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Messaging; +import io.appwrite.services.Users; +import io.appwrite.enums.MessagingProviderType; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -Messaging messaging = new Messaging(client); +Users users = new Users(client); -messaging.createSubscriber( - "[TOPIC_ID]", // topicId - "[SUBSCRIBER_ID]", // subscriberId - "[TARGET_ID]" // targetId - new CoroutineCallback<>((result, error) -> { +users.createTarget( + "", // userId + "", // targetId + MessagingProviderType.PHONE, // providerType + "", // identifier + "", // providerId (optional) + "", // name (optional) + new CoroutineCallback<>((target, error) -> { if (error != null) { error.printStackTrace(); return; } - System.out.println(result); + System.out.println(target); }) ); ``` ```swift import Appwrite +import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -let messaging = Messaging(client) +let users = Users(client) -let subscriber = try await messaging.createSubscriber( - topicId: "[TOPIC_ID]", - subscriberId: "[SUBSCRIBER_ID]", - targetId: "[TARGET_ID]" +let target = try await users.createTarget( + userId: "", + targetId: "", + providerType: .phone, + identifier: "", + providerId: "", // optional + name: "" // optional ) ``` {% /multicode %} @@ -296,52 +292,32 @@ You can also create topics programmatically using an [Appwrite Server SDK](/docs ```js const sdk = require('node-appwrite'); -// Init SDK -const client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key const messaging = new sdk.Messaging(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -const promise = messaging.createTopic( - '[TOPIC_ID]', // topicId - '[NAME]' // name - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const topic = await messaging.createTopic( + '[TOPIC_ID]', // topicId + '[NAME]' // name +); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; -// Init SDK -let client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key -let messaging = new sdk.Messaging(client); +const messaging = new sdk.Messaging(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -const promise = messaging.createTopic( - '[TOPIC_ID]', // topicId - '[NAME]' // name - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const topic = await messaging.createTopic( + '[TOPIC_ID]', // topicId + '[NAME]' // name +); ``` ```php setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; +$client = (new Client()) + ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key $messaging = new Messaging($client); @@ -369,16 +342,13 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) -result = messaging.create_topic( +topic = messaging.create_topic( topic_id = '[TOPIC_ID]', name = '[NAME]' ) @@ -395,79 +365,60 @@ client = Client.new messaging = Messaging.new(client) -response = messaging.create_topic( +topic = messaging.create_topic( topic_id: '[TOPIC_ID]', name: '[NAME]' ) - -puts response.inspect ``` ```csharp using Appwrite; using Appwrite.Services; using Appwrite.Models; -var client = new Client() +Client client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint .SetProject("5df5acd0d48c2") // Your project ID .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -var messaging = new Messaging(client); +Messaging messaging = new Messaging(client); -Topic result = await messaging.CreateTopic( +Topic topic = await messaging.CreateTopic( topicId: "[TOPIC_ID]", name: "[NAME]"); ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; -void main() { // Init SDK - Client client = Client(); - Messaging messaging = Messaging(client); +Client client = Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key - client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; +Messaging messaging = Messaging(client); - Future result = messaging.createTopic( +Topic topic = await messaging.createTopic( topicId: '[TOPIC_ID]', name: '[NAME]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} +); ``` ```kotlin import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; -Client client = new Client() +val client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -Messaging messaging = new Messaging(client); +val messaging = new Messaging(client) -messaging.createTopic( - "[TOPIC_ID]", // topicId - "[NAME]" // name - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); +val topic = messaging.createTopic( + topicId = "[TOPIC_ID]", + name = "[NAME]" +) ``` ```java import io.appwrite.Client; @@ -475,15 +426,15 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Messaging messaging = new Messaging(client); messaging.createTopic( - "[TOPIC_ID]", // topicId - "[NAME]" // name + "[TOPIC_ID]", // topicId + "[NAME]", // name new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); @@ -505,76 +456,57 @@ let client = Client() let messaging = Messaging(client) let topic = try await messaging.createTopic( - topicId: "[TOPIC_ID]", - name: "[NAME]" + topicId: "[TOPIC_ID]", + name: "[NAME]" ) ``` {% /multicode %} # Send SMS messages {% #send-sms %} You can send SMS messages using a Server SDK. -To send an SMS messages immediately, you can call the `createSMS` endpoint with `status` set to `'processing'` and `schedule` left empty. +To send an SMS messages immediately, you can call the `createSMS` endpoint without passing either the `draft` or `scheduledAt` parameters. {% multicode %} ```js const sdk = require('node-appwrite'); // Init SDK -const client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key const messaging = new sdk.Messaging(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -const promise = messaging.createSMS( - '[MESSAGE_ID]', // messageId - '[CONTENT]', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - 'processing', // status (optional) - '' // scheduledAt (optional) - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const message = await messaging.createSMS( + '[MESSAGE_ID]', // messageId + '[CONTENT]', // content + [], // topics (optional) + [], // users (optional) + [], // targets (optional) + false, // draft (optional) + '' // scheduledAt (optional) +); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; -// Init SDK -let client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key -let messaging = new sdk.Messaging(client); +const messaging = new sdk.Messaging(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -const promise = messaging.createSMS( - '[MESSAGE_ID]', // messageId - '[CONTENT]', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - 'processing', // status (optional) - '' // scheduledAt (optional) - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const message = await messaging.createSMS( + '[MESSAGE_ID]', // messageId + '[CONTENT]', // content + [], // topics (optional) + [], // users (optional) + [], // targets (optional) + false, // draft (optional) + '' // scheduledAt (optional) +); ``` ```php setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; + ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key $messaging = new Messaging($client); $result = $messaging->createSMS( messageId: '[MESSAGE_ID]', content: '[CONTENT]', - topics: [], // optional - users: [], // optional - targets: [], // optional - status: 'processing', // optional - scheduledAt: '' // optional + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '' // optional ); ``` ```python @@ -607,23 +538,20 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging(client) result = messaging.create_sms( message_id = '[MESSAGE_ID]', content = '[CONTENT]', - topics = [], # optional - users = [], # optional - targets = [], # optional - status = 'processing', # optional - scheduled_at = '' # optional + topics = [], # optional + users = [], # optional + targets = [], # optional + draft = false, # optional + scheduled_at = '' # optional ) ``` ```ruby @@ -632,397 +560,107 @@ require 'appwrite' include Appwrite client = Client.new - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging.new(client) response = messaging.create_sms( message_id: '[MESSAGE_ID]', content: '[CONTENT]', - topics: [], # optional - users: [], # optional - targets: [], # optional - status: 'processing', # optional - scheduled_at: '' # optional + topics: [], # optional + users: [], # optional + targets: [], # optional + draft: false, # optional + scheduled_at: '' # optional ) - -puts response.inspect ``` ```csharp using Appwrite; using Appwrite.Services; using Appwrite.Models; -var client = new Client() - .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("5df5acd0d48c2") // Your project ID - .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key +Client client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key -var messaging = new Messaging(client); +Messaging messaging = new Messaging(client); -Message result = await messaging.CreateSMS( +Message message = await messaging.CreateSMS( messageId: "[MESSAGE_ID]", content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - status: "processing" // optional - scheduledAt: ""); // optional + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + draft: false, // optional + scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; -void main() { // Init SDK - Client client = Client(); - Messaging messaging = Messaging(client); +Client client = Client(); + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key - client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; +Messaging messaging = Messaging(client); - Future result = messaging.createSMS( +Message message result = await messaging.createSMS( messageId: '[MESSAGE_ID]', content: '[CONTENT]', - topics: [], // optional - users: [], // optional - targets: [], // optional - status: 'processing', // optional - scheduledAt: '', // optional - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '' // optional +); ``` ```kotlin import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; -Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - -Messaging messaging = new Messaging(client); - -messaging.createSMS( - "[MESSAGE_ID]", // messageId - "[CONTENT]", // content - listOf(), // topics (optional) - listOf(), // users (optional) - listOf(), // targets (optional) - "processing", // status (optional) - "" // scheduledAt (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); -``` -```java -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Messaging; - -Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - -Messaging messaging = new Messaging(client); - -messaging.createSMS( - "[MESSAGE_ID]", // messageId - "[CONTENT]", // content - listOf(), // topics (optional) - listOf(), // users (optional) - listOf(), // targets (optional) - "processing", // status (optional) - "" // scheduledAt (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); -``` -```swift -import Appwrite - -let client = Client() +val client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key -let messaging = Messaging(client) +val messaging = Messaging(client) -let message = try await messaging.createSMS( - messageId: "[MESSAGE_ID]", - content: "[CONTENT]", - topics: [], // optional - users: [], // optional - targets: [], // optional - status: "processing", // optional - scheduledAt: "" // optional +val message - await messaging.createSMS( + messageId = "[MESSAGE_ID]", + content = "[CONTENT]", + topics = listOf(), + users = listOf(), + targets = listOf(), + draft = false, + scheduledAt = "" ) ``` -{% /multicode %} - -# Schedule SMS message {% #schedule-sms %} -To send an scheduled SMS message, you can call the `createSMS` endpoint with `status` set to `'scheduled'` and `schedule` as a ISO 8601 date time string for the scheduled time. -{% multicode %} -```js -const sdk = require('node-appwrite'); - -// Init SDK -const client = new sdk.Client(); - -const messaging = new sdk.Messaging(client); - -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -const promise = messaging.createSMS( - '[MESSAGE_ID]', // messageId - '[CONTENT]', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - 'scheduled', // status (optional) - '2025-02-13T22:01:00+0000' // scheduledAt (optional) - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); -``` -```deno -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -// Init SDK -let client = new sdk.Client(); - -let messaging = new sdk.Messaging(client); - -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -const promise = messaging.createSMS( - '[MESSAGE_ID]', // messageId - '[CONTENT]', // content - [], // topics (optional) - [], // users (optional) - [], // targets (optional) - 'scheduled', // status (optional) - '2025-02-13T22:01:00+0000' // scheduledAt (optional) - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); -``` -```php -setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -$messaging = new Messaging($client); - -$result = $messaging->createSMS( - messageId: '[MESSAGE_ID]', - content: '[CONTENT]', - topics: [], // optional - users: [], // optional - targets: [], // optional - status: 'scheduled', // optional - scheduledAt: '2025-02-13T22:01:00+0000' // optional -); -``` -```python -from appwrite.client import Client -from appwrite.services.messaging import Messaging - -client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key -) - -messaging = Messaging(client) - -result = messaging.create_sms( - message_id = '[MESSAGE_ID]', - content = '[CONTENT]', - topics = [], # optional - users = [], # optional - targets = [], # optional - status = 'scheduled', # optional - scheduled_at = '2025-02-13T22:01:00+0000' # optional -) -``` -```ruby -require 'appwrite' - -include Appwrite - -client = Client.new - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key - -messaging = Messaging.new(client) - -response = messaging.create_sms( - message_id: '[MESSAGE_ID]', - content: '[CONTENT]', - topics: [], # optional - users: [], # optional - targets: [], # optional - status: 'scheduled', # optional - scheduled_at: '2025-02-13T22:01:00+0000' # optional -) - -puts response.inspect -``` -```csharp -using Appwrite; -using Appwrite.Services; -using Appwrite.Models; - -var client = new Client() - .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("5df5acd0d48c2") // Your project ID - .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - -var messaging = new Messaging(client); - -Message result = await messaging.CreateSMS( - messageId: "[MESSAGE_ID]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - status: "scheduled" // optional - scheduledAt: "2025-02-13T22:01:00+0000"); // optional -``` -```dart -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() { // Init SDK - Client client = Client(); - Messaging messaging = Messaging(client); - - client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key - ; - - Future result = messaging.createSMS( - messageId: '[MESSAGE_ID]', - content: '[CONTENT]', - topics: [], // optional - users: [], // optional - targets: [], // optional - status: 'scheduled', // optional - scheduledAt: '2025-02-13T22:01:00+0000', // optional - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} -``` -```kotlin -import io.appwrite.Client; -import io.appwrite.coroutines.CoroutineCallback; -import io.appwrite.services.Messaging; - -Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key - -Messaging messaging = new Messaging(client); - -messaging.createSMS( - "[MESSAGE_ID]", // messageId - "[CONTENT]", // content - listOf(), // topics (optional) - listOf(), // users (optional) - listOf(), // targets (optional) - "scheduled", // status (optional) - 2025-02-13T22:01:00+0000" // scheduledAt (optional) - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); -``` ```java import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Messaging messaging = new Messaging(client); messaging.createSMS( - "[MESSAGE_ID]", // messageId - "[CONTENT]", // content - listOf(), // topics (optional) - listOf(), // users (optional) - listOf(), // targets (optional) - "scheduled", // status (optional) - "2025-02-13T22:01:00+0000" // scheduledAt (optional) + "[MESSAGE_ID]", // messageId + "[CONTENT]", // content + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + false, // draft (optional) + "", // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); @@ -1037,20 +675,249 @@ messaging.createSMS( import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key let messaging = Messaging(client) let message = try await messaging.createSMS( - messageId: "[MESSAGE_ID]", - content: "[CONTENT]", - topics: [], // optional - users: [], // optional - targets: [], // optional - status: "scheduled", // optional - scheduledAt: "2025-02-13T22:01:00+0000" // optional + messageId: "[MESSAGE_ID]", + content: "[CONTENT]", + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: "" // optional +) +``` +{% /multicode %} + +# Schedule SMS message {% #schedule-sms %} +To send an scheduled SMS message, you can call the `createSMS` endpoint with `scheduledAt` as a ISO 8601 date time string for the scheduled time. +{% multicode %} +```js +const sdk = require('node-appwrite'); + +// Init SDK +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const message = await messaging.createSMS( + '[MESSAGE_ID]', // messageId + '[CONTENT]', // content + [], // topics (optional) + [], // users (optional) + [], // targets (optional) + false, // draft (optional) + '2025-02-13T22:01:00+0000' // scheduledAt (optional) +); +``` +```deno +import * as sdk from "https://deno.land/x/appwrite/mod.ts"; + +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key + +const messaging = new sdk.Messaging(client); + +const message = await messaging.createSMS( + '[MESSAGE_ID]', // messageId + '[CONTENT]', // content + [], // topics (optional) + [], // users (optional) + [], // targets (optional) + false, // draft (optional) + '2025-02-13T22:01:00+0000' // scheduledAt (optional) +); +``` +```php +setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key + +$messaging = new Messaging($client); + +$result = $messaging->createSMS( + messageId: '[MESSAGE_ID]', + content: '[CONTENT]', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '2025-02-13T22:01:00+0000' // optional +); +``` +```python +from appwrite.client import Client +from appwrite.services.messaging import Messaging + +client = Client() +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +messaging = Messaging(client) + +result = messaging.create_sms( + message_id = '[MESSAGE_ID]', + content = '[CONTENT]', + topics = [], # optional + users = [], # optional + targets = [], # optional + draft = false, # optional + scheduled_at = '2025-02-13T22:01:00+0000' # optional +) +``` +```ruby +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + +messaging = Messaging.new(client) + +response = messaging.create_sms( + message_id: '[MESSAGE_ID]', + content: '[CONTENT]', + topics: [], # optional + users: [], # optional + targets: [], # optional + draft: false, # optional + scheduled_at: '2025-02-13T22:01:00+0000' # optional +) +``` +```csharp +using Appwrite; +using Appwrite.Services; +using Appwrite.Models; + +Client client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +Messaging messaging = new Messaging(client); + +Message message = await messaging.CreateSMS( + messageId: "[MESSAGE_ID]", + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + draft: false, // optional + scheduledAt: "2025-02-13T22:01:00+0000"); // optional +``` +```dart +import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; + +Client client = Client(); + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setKey('919c2d18fb5d4...a2ae413da83346ad2'); // Your secret API key + +Messaging messaging = Messaging(client); + +Message message result = await messaging.createSMS( + messageId: '[MESSAGE_ID]', + content: '[CONTENT]', + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: '2025-02-13T22:01:00+0000' // optional +); +``` +```kotlin +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +val client = Client() + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + +val messaging = Messaging(client) + +val message - await messaging.createSMS( + messageId = "[MESSAGE_ID]", + content = "[CONTENT]", + topics = listOf(), + users = listOf(), + targets = listOf(), + draft = false, + scheduledAt = "2025-02-13T22:01:00+0000" +) +``` +```java +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createSMS( + "[MESSAGE_ID]", // messageId + "[CONTENT]", // content + listOf(), // topics (optional) + listOf(), // users (optional) + listOf(), // targets (optional) + false, // draft (optional) + "2025-02-13T22:01:00+0000", // scheduledAt (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); +``` +```swift +import Appwrite + +let client = Client() + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key + +let messaging = Messaging(client) + +let message = try await messaging.createSMS( + messageId: "[MESSAGE_ID]", + content: "[CONTENT]", + topics: [], // optional + users: [], // optional + targets: [], // optional + draft: false, // optional + scheduledAt: "2025-02-13T22:01:00+0000" // optional ) ``` {% /multicode %} \ No newline at end of file diff --git a/src/routes/docs/products/messaging/sendgrid/+page.markdoc b/src/routes/docs/products/messaging/sendgrid/+page.markdoc index 0ba0c8712..dc797ea8c 100644 --- a/src/routes/docs/products/messaging/sendgrid/+page.markdoc +++ b/src/routes/docs/products/messaging/sendgrid/+page.markdoc @@ -96,13 +96,7 @@ client .setKey('') // Your secret API key ; -const promise = messaging.createEmail('', '', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const message - await messaging.createEmail('', '', ''); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -119,13 +113,7 @@ client ; -let promise = messaging.createEmail('', '', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const messaging = await messaging.createEmail('', '', ''); ``` ```php ') // Your secret API key ; -const promise = messaging.updateMailgunProvider( +const provider = await messaging.updateMailgunProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) '[API_KEY]', // apiKey (optional) @@ -328,12 +318,6 @@ const promise = messaging.updateMailgunProvider( '[REPLY_TO_NAME]', // replyToName (optional) '[REPLY_TO_EMAIL]' // replyToEmail (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -349,7 +333,7 @@ client .setKey('') // Your secret API key ; -const promise = messaging.updateMailgunProvider( +const provider = await messaging.updateMailgunProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) '[API_KEY]', // apiKey (optional) @@ -361,12 +345,6 @@ const promise = messaging.updateMailgunProvider( '[REPLY_TO_NAME]', // replyToName (optional) '[REPLY_TO_EMAIL]' // replyToEmail (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php ') // Your secret API key ; -const promise = messaging.createEmail('', '', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +cconst message - await messaging.createEmail('', '', ''); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -124,13 +118,7 @@ client .setKey('') // Your secret API key ; -let promise = messaging.createEmail('', '', ''); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const messaging = await messaging.createEmail('', '', ''); ``` ```php createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '' // optional ); ``` @@ -172,7 +160,7 @@ result = messaging.create_sms( topics = [], # optional users = [], # optional targets = [], # optional - status = 'draft', # optional + draft = True, # optional scheduled_at = '' # optional ) ``` @@ -194,7 +182,7 @@ response = messaging.create_sms( topics: [], # optional users: [], # optional targets: [], # optional - status: 'draft', # optional + draft: true, # optional scheduled_at: '' # optional ) @@ -214,15 +202,17 @@ var messaging = new Messaging(client); Message result = await messaging.CreateSMS( messageId: "[MESSAGE_ID]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - status: "draft" // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + draft: true // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -240,7 +230,7 @@ void main() { // Init SDK topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '', // optional ); @@ -270,7 +260,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -300,7 +290,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -328,7 +318,7 @@ let message = try await messaging.createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: "draft", // optional + draft: true, // optional scheduledAt: "" // optional ) ``` @@ -365,7 +355,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateTelesignProvider( +const provider = await messaging.updateTelesignProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -373,12 +363,6 @@ const promise = messaging.updateTelesignProvider( '[PASSWORD]', // password (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -394,7 +378,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateTelesignProvider( +const provider = await messaging.updateTelesignProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -402,12 +386,6 @@ const promise = messaging.updateTelesignProvider( '[PASSWORD]', // password (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '' // optional ); ``` @@ -172,7 +160,7 @@ result = messaging.create_sms( topics = [], # optional users = [], # optional targets = [], # optional - status = 'draft', # optional + draft = True, # optional scheduled_at = '' # optional ) ``` @@ -194,7 +182,7 @@ response = messaging.create_sms( topics: [], # optional users: [], # optional targets: [], # optional - status: 'draft', # optional + draft: true, # optional scheduled_at: '' # optional ) @@ -214,15 +202,17 @@ var messaging = new Messaging(client); Message result = await messaging.CreateSMS( messageId: "[MESSAGE_ID]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - status: "draft" // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + draft: true // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -240,7 +230,7 @@ void main() { // Init SDK topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '', // optional ); @@ -270,7 +260,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -300,7 +290,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -328,7 +318,7 @@ let message = try await messaging.createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: "draft", // optional + draft: true, // optional scheduledAt: "" // optional ) ``` @@ -365,7 +355,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateTextmagicProvider( +const provider = await messaging.updateTextmagicProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -373,12 +363,6 @@ const promise = messaging.updateTextmagicProvider( '[API_KEY]', // apiKey (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -394,7 +378,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateTextmagicProvider( +const provider = await messaging.updateTextmagicProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -402,12 +386,6 @@ const promise = messaging.updateTextmagicProvider( '[API_KEY]', // apiKey (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint ->setProject('5df5acd0d48c2') // Your project ID - ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key + ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; $messaging = new Messaging($client); -$result = $messaging->createTopic( - topicId: '[TOPIC_ID]', +$topic = $messaging->createTopic( + topicId: '[TOPIC_ID]', name: '[NAME]', subscribe: '[ROLES]' // permission roles for who can subscribe @@ -128,13 +117,13 @@ client = Client() (client .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key ) messaging = Messaging(client) -result = messaging.create_topic( - topic_id = '[TOPIC_ID]', +topic = messaging.create_topic( + topic_id = '[TOPIC_ID]', name = '[NAME]', subscribe = '[ROLES]' # permission roles for who can subscribe ) @@ -147,17 +136,17 @@ include Appwrite client = Client.new .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID - .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key + .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key messaging = Messaging.new(client) -response = messaging.create_topic( - topic_id: '[TOPIC_ID]', +topic = messaging.create_topic( + topic_id: '[TOPIC_ID]', name: '[NAME]', subscribe: '[ROLES]' # permission roles for who can subscribe ) -puts response.inspect +puts topic.inspect ``` ```csharp using Appwrite; @@ -166,18 +155,20 @@ using Appwrite.Models; var client = new Client() .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("5df5acd0d48c2") // Your project ID - .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + .SetProject("5df5acd0d48c2") // Your project ID + .SetKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key var messaging = new Messaging(client); -Topic result = await messaging.CreateTopic( +Topic topic = await messaging.CreateTopic( topicId: "[TOPIC_ID]", name: "[NAME]", subscribe: "[ROLES]") // permission roles for who can subscribe ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -186,7 +177,7 @@ void main() { // Init SDK client .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key + .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; Future result = messaging.createTopic( @@ -210,8 +201,8 @@ import io.appwrite.services.Messaging; Client client = new Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key + .setProject("5df5acd0d48c2") // Your project ID + .setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key Messaging messaging = new Messaging(client); @@ -219,13 +210,13 @@ messaging.createTopic( "[TOPIC_ID]", // topicId "[NAME]" // name "[ROLES]" // permission roles for who can subscribe - new CoroutineCallback<>((result, error) -> { + new CoroutineCallback<>((topic, error) -> { if (error != null) { error.printStackTrace(); return; } - System.out.println(result); + System.out.println(topic); }) ); ``` @@ -245,13 +236,13 @@ messaging.createTopic( "[TOPIC_ID]", // topicId "[NAME]" // name "[ROLES]" // permission roles for who can subscribe - new CoroutineCallback<>((result, error) -> { + new CoroutineCallback<>((topic, error) -> { if (error != null) { error.printStackTrace(); return; } - System.out.println(result); + System.out.println(topic); }) ); ``` @@ -303,54 +294,34 @@ If you can't find the targets you'd like to add, see the [targets page](/docs/pr ```js const sdk = require('node-appwrite'); -// Init SDK -const client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setJWT('eyJhbVCJ9.eyJ...'); // Your secret JSON Web Token const messaging = new sdk.Messaging(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token -; - -const promise = messaging.createSubscriber( - '[TOPIC_ID]', // topicId - '[SUBSCRIBER_ID]', // subscriberId - '[TARGET_ID]' // targetId - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const subscriber = await messaging.createSubscriber( + '[TOPIC_ID]', // topicId + '[SUBSCRIBER_ID]', // subscriberId + '[TARGET_ID]' // targetId +); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; -// Init SDK -let client = new sdk.Client(); +const client = new sdk.Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setJWT('eyJhbVCJ9.eyJ...'); // Your secret JSON Web Token -let messaging = new sdk.Messaging(client); +const messaging = new sdk.Messaging(client); -client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token -; - -const promise = messaging.createSubscriber( - '[TOPIC_ID]', // topicId - '[SUBSCRIBER_ID]', // subscriberId - '[TARGET_ID]' // targetId - ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); +const subscriber = await messaging.createSubscriber( + '[TOPIC_ID]', // topicId + '[SUBSCRIBER_ID]', // subscriberId + '[TARGET_ID]' // targetId +); ``` ```php setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('5df5acd0d48c2') // Your project ID - ->setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token -; + ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + ->setProject('5df5acd0d48c2') // Your project ID + ->setJWT('eyJhbVCJ9.eyJ...'); // Your secret JSON Web Token $messaging = new Messaging($client); -$result = $messaging->createSubscriber( - topicId: '[TOPIC_ID]', - subscriberId: '[SUBSCRIBER_ID]', +$subscriber = $messaging->createSubscriber( + topicId: '[TOPIC_ID]', + subscriberId: '[SUBSCRIBER_ID]', targetId: '[TARGET_ID]' ); ``` @@ -379,18 +349,15 @@ from appwrite.client import Client from appwrite.services.messaging import Messaging client = Client() - -(client - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token -) +client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint +client.set_project('5df5acd0d48c2') # Your project ID +client.set_jwt('eyJhbVCJ9.eyJ...') # Your secret JSON Web Token messaging = Messaging(client) -result = messaging.create_subscriber( - topic_id = '[TOPIC_ID]', - subscriber_id = '[SUBSCRIBER_ID]', +subscriber = messaging.create_subscriber( + topic_id = '[TOPIC_ID]', + subscriber_id = '[SUBSCRIBER_ID]', target_id = '[TARGET_ID]' ) ``` @@ -400,31 +367,29 @@ require 'appwrite' include Appwrite client = Client.new - .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint - .set_project('5df5acd0d48c2') # Your project ID - .set_jwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') # Your secret JSON Web Token + .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint + .set_project('5df5acd0d48c2') # Your project ID + .set_jwt('eyJhbVCJ9.eyJ...') # Your secret JSON Web Token messaging = Messaging.new(client) -response = messaging.create_subscriber( - topic_id: '[TOPIC_ID]', - subscriber_id: '[SUBSCRIBER_ID]', +subscriber = messaging.create_subscriber( + topic_id: '[TOPIC_ID]', + subscriber_id: '[SUBSCRIBER_ID]', target_id: '[TARGET_ID]' ) - -puts response.inspect ``` ```csharp using Appwrite; using Appwrite.Services; using Appwrite.Models; -var client = new Client() - .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .SetProject("5df5acd0d48c2") // Your project ID - .SetJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token +Client client = new Client() + .SetEndPoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("5df5acd0d48c2") // Your project ID + .SetJWT("eyJhbVCJ9.eyJ..."); // Your secret JSON Web Token -var messaging = new Messaging(client); +Messaging messaging = new Messaging(client); Subscriber result = await messaging.CreateSubscriber( topicId: "[TOPIC_ID]", @@ -433,56 +398,39 @@ Subscriber result = await messaging.CreateSubscriber( ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; -void main() { // Init SDK - Client client = Client(); - Messaging messaging = Messaging(client); +Client client = Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('5df5acd0d48c2') // Your project ID + .setJWT('eyJhbVCJ9.eyJ...'); // Your secret JSON Web Token - client - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token - ; +Messaging messaging = Messaging(client); - Future result = messaging.createSubscriber( +Subscriber subscriber result = await messaging.createSubscriber( topicId: '[TOPIC_ID]', subscriberId: '[SUBSCRIBER_ID]', targetId: '[TARGET_ID]', - ); - - result - .then((response) { - print(response); - }).catchError((error) { - print(error.response); - }); -} +); ``` ```kotlin import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; -Client client = new Client() +val client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbVCJ9.eyJ...") // Your secret JSON Web Token -Messaging messaging = new Messaging(client); +val messaging = new Messaging(client) -messaging.createSubscriber( - "[TOPIC_ID]", // topicId - "[SUBSCRIBER_ID]", // subscriberId - "[TARGET_ID]" // targetId - new CoroutineCallback<>((result, error) -> { - if (error != null) { - error.printStackTrace(); - return; - } - - System.out.println(result); - }) -); +val subscriber = messaging.createSubscriber( + topicId = "[TOPIC_ID]", + subscriberId = "[SUBSCRIBER_ID]", + targetId = "[TARGET_ID]" +) ``` ```java import io.appwrite.Client; @@ -490,16 +438,16 @@ import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Messaging; Client client = new Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbVCJ9.eyJ..."); // Your secret JSON Web Token Messaging messaging = new Messaging(client); messaging.createSubscriber( - "[TOPIC_ID]", // topicId - "[SUBSCRIBER_ID]", // subscriberId - "[TARGET_ID]" // targetId + "[TOPIC_ID]", // topicId + "[SUBSCRIBER_ID]", // subscriberId + "[TARGET_ID]" // targetId new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); @@ -514,16 +462,16 @@ messaging.createSubscriber( import Appwrite let client = Client() - .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint - .setProject("5df5acd0d48c2") // Your project ID - .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token + .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setJWT("eyJhbVCJ9.eyJ...") // Your secret JSON Web Token let messaging = Messaging(client) let subscriber = try await messaging.createSubscriber( - topicId: "[TOPIC_ID]", - subscriberId: "[SUBSCRIBER_ID]", - targetId: "[TARGET_ID]" + topicId: "[TOPIC_ID]", + subscriberId: "[SUBSCRIBER_ID]", + targetId: "[TARGET_ID]" ) ``` {% /multicode %} diff --git a/src/routes/docs/products/messaging/twilio/+page.markdoc b/src/routes/docs/products/messaging/twilio/+page.markdoc index 9e9d85945..4dda95b6e 100644 --- a/src/routes/docs/products/messaging/twilio/+page.markdoc +++ b/src/routes/docs/products/messaging/twilio/+page.markdoc @@ -81,21 +81,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createSMS( +const message = await messaging.createSMS( '[MESSAGE_ID]', // messageId '[CONTENT]', // content [], // topics (optional) [], // users (optional) [], // targets (optional) - 'draft', // status (optional) + true, // draft (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -111,21 +105,15 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.createSMS( +const message = await messaging.createSMS( '[MESSAGE_ID]', // messageId '[CONTENT]', // content [], // topics (optional) [], // users (optional) [], // targets (optional) - 'draft', // status (optional) + true, // draft (optional) '' // scheduledAt (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '' // optional ); ``` @@ -173,7 +161,7 @@ result = messaging.create_sms( topics = [], # optional users = [], # optional targets = [], # optional - status = 'draft', # optional + draft = True, # optional scheduled_at = '' # optional ) ``` @@ -195,7 +183,7 @@ response = messaging.create_sms( topics: [], # optional users: [], # optional targets: [], # optional - status: 'draft', # optional + draft: true, # optional scheduled_at: '' # optional ) @@ -215,15 +203,17 @@ var messaging = new Messaging(client); Message result = await messaging.CreateSMS( messageId: "[MESSAGE_ID]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - status: "draft" // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + draft: true // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -241,7 +231,7 @@ void main() { // Init SDK topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '', // optional ); @@ -271,7 +261,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -301,7 +291,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -329,7 +319,7 @@ let message = try await messaging.createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: "draft", // optional + draft: true, // optional scheduledAt: "" // optional ) ``` @@ -364,7 +354,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateTwilioProvider( +const provider = await messaging.updateTwilioProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -372,12 +362,6 @@ const promise = messaging.updateTwilioProvider( '[AUTH_TOKEN]', // authToken (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -393,7 +377,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateTwilioProvider( +const provider = await messaging.updateTwilioProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -401,12 +385,6 @@ const promise = messaging.updateTwilioProvider( '[AUTH_TOKEN]', // authToken (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '' // optional ); ``` @@ -173,7 +161,7 @@ result = messaging.create_sms( topics = [], # optional users = [], # optional targets = [], # optional - status = 'draft', # optional + draft = True, # optional scheduled_at = '' # optional ) ``` @@ -195,7 +183,7 @@ response = messaging.create_sms( topics: [], # optional users: [], # optional targets: [], # optional - status: 'draft', # optional + draft: true, # optional scheduled_at: '' # optional ) @@ -215,15 +203,17 @@ var messaging = new Messaging(client); Message result = await messaging.CreateSMS( messageId: "[MESSAGE_ID]", - content: "[CONTENT]" - topics: new List {} // optional - users: new List {} // optional - targets: new List {} // optional - status: "draft" // optional + content: "[CONTENT]" + topics: new List {} // optional + users: new List {} // optional + targets: new List {} // optional + draft: true // optional scheduledAt: ""); // optional ``` ```dart import 'package:dart_appwrite/dart_appwrite.dart'; +import 'package:dart_appwrite/enums.dart'; +import 'package:dart_appwrite/models.dart'; void main() { // Init SDK Client client = Client(); @@ -241,7 +231,7 @@ void main() { // Init SDK topics: [], // optional users: [], // optional targets: [], // optional - status: 'draft', // optional + draft: true, // optional scheduledAt: '', // optional ); @@ -271,7 +261,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -301,7 +291,7 @@ messaging.createSMS( listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) - "draft", // status (optional) + true, // draft (optional) "" // scheduledAt (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { @@ -329,7 +319,7 @@ let message = try await messaging.createSMS( topics: [], // optional users: [], // optional targets: [], // optional - status: "draft", // optional + draft: true, // optional scheduledAt: "" // optional ) ``` @@ -366,7 +356,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateVonageProvider( +const provider = await messaging.updateVonageProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -374,12 +364,6 @@ const promise = messaging.updateVonageProvider( '[API_SECRET]', // apiSecret (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```deno import * as sdk from "https://deno.land/x/appwrite/mod.ts"; @@ -395,7 +379,7 @@ client .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key ; -const promise = messaging.updateVonageProvider( +const provider = await messaging.updateVonageProvider( '[PROVIDER_ID]', // providerId '[NAME]', // name (optional) false, // enabled (optional) @@ -403,12 +387,6 @@ const promise = messaging.updateVonageProvider( '[API_SECRET]', // apiSecret (optional) '[FROM]' // from (optional) ); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); ``` ```php ` with your project ID and `` with your application id or package name. + +This imports and initializes Appwrite. + +```js +import { Client, Account, ID } from 'react-native-appwrite'; + +let client: Client; +let account: Account; + +function App(): React.JSX.Element { + const isDarkMode = useColorScheme() === 'dark'; + + let setupAppwrite = async () => { + client = new Client(); + client + .setEndpoint('https://cloud.appwrite.io/v1') + .setProject('') + .setPlatform(''); + + account = new Account(client); + } +} +``` +{% /section %} +{% section #step-5 step=5 title="Make first request" %} +With `Client` and `Account` service initialized, you can now make your first requests to Appwrite. + +```js +let createUser = async () => { + let user = await account.create(ID.unique(), 'example@email.com', 'strongPassword', 'Example user'); + console.log(user); +} +``` + +{% /section %} + +{% section #step-6 step=6 title="All set" %} +Run your project with `npm run ios` or `npm run android`. + +{% arrow_link href="https://github.com/appwrite/playground-for-react-native" %} +React Native playground +{% /arrow_link %} +{% /section %} diff --git a/src/routes/docs/quick-starts/react/+page.markdoc b/src/routes/docs/quick-starts/react/+page.markdoc index ce32a9976..8a5b89767 100644 --- a/src/routes/docs/quick-starts/react/+page.markdoc +++ b/src/routes/docs/quick-starts/react/+page.markdoc @@ -8,6 +8,12 @@ back: /docs/quick-starts --- Learn how to setup your first React project powered by Appwrite. + +{% info title="React Native" %} +Looking to start with React Native? +Follow the [React Native quickstart](/docs/quick-starts/react-native) to build apps for iOS, Android, and other native platforms. +{% /info %} + {% section #step-1 step=1 title="Create project" %} Head to the [Appwrite Console](https://cloud.appwrite.io/console). diff --git a/src/routes/docs/references/[version]/[platform]/[service]/(components)/RateLimits.svelte b/src/routes/docs/references/[version]/[platform]/[service]/(components)/RateLimits.svelte new file mode 100644 index 000000000..997d540f7 --- /dev/null +++ b/src/routes/docs/references/[version]/[platform]/[service]/(components)/RateLimits.svelte @@ -0,0 +1,109 @@ + + +
+
+ +
+
+ + + + + + + + + + {#if hasMultipleKeys(rateKeys)} + {#each rateKeys as key, i} + + + + + + {/each} + {:else if typeof rateKeys === 'string'} + + + + + + {/if} + +
+
Time frame
+
+
Attempts
+
+
Key
+
{Math.floor(rateTime / 60)} minutes{rateLimit} requests{parseKeys(key)}
{Math.floor(rateTime / 60)} minutes{rateLimit} requests{parseKeys(rateKeys)}
+
+
+
+ + Learn more about rate limits + + +
+
+
+ + diff --git a/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte b/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte index 5286f41bf..1f428492d 100644 --- a/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte +++ b/src/routes/docs/references/[version]/[platform]/[service]/+page.svelte @@ -25,6 +25,7 @@ import { Accordion, AccordionItem } from '$lib/components/Accordion'; import Request from './(components)/Request.svelte'; import Response from './(components)/Response.svelte'; + import RateLimits from './(components)/RateLimits.svelte'; export let data; @@ -204,6 +205,11 @@ + {#if method?.['rate-limit'] > 0 && method?.['rate-key']?.length > 0} + + + + {/if}
diff --git a/src/routes/docs/sdks/+page.markdoc b/src/routes/docs/sdks/+page.markdoc index 8eb5ef587..eb83b176a 100644 --- a/src/routes/docs/sdks/+page.markdoc +++ b/src/routes/docs/sdks/+page.markdoc @@ -41,6 +41,12 @@ Client libraries for integrating with Appwrite to build client-based application * Android SDK `4.0.0` * [appwrite/sdk-for-android](https://github.com/appwrite/sdk-for-android) * +--- +* {% only_dark %}{% icon_image src="/images/platforms/dark/react.svg" alt="React logo" size="m" /%}{% /only_dark %} +{% only_light %}{% icon_image src="/images/platforms/react.svg" alt="React logo" size="m" /%}{% /only_light %} +* React Native SDK `0.1.0` +* [appwrite/sdk-for-react-native](https://github.com/appwrite/sdk-for-react-native) +* `beta` {% /table %} # Server {% #server %} @@ -368,4 +374,4 @@ Learn more about [storage input file classes](/docs/products/storage/upload-down # Community {% #community %} If you have created your own framework or any other technology specific integration and would like us to list it here please [contact us](/contact-us). -If you would like to help us expand Appwrite's list of SDKs, you can contribute to Appwrite's [SDK Generator](https://github.com/appwrite/sdk-generator) project on GitHub and read our [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md). \ No newline at end of file +If you would like to help us expand Appwrite's list of SDKs, you can contribute to Appwrite's [SDK Generator](https://github.com/appwrite/sdk-generator) project on GitHub and read our [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md). diff --git a/src/routes/docs/tooling/command-line/installation/+page.markdoc b/src/routes/docs/tooling/command-line/installation/+page.markdoc index b72eeea79..c467c8315 100644 --- a/src/routes/docs/tooling/command-line/installation/+page.markdoc +++ b/src/routes/docs/tooling/command-line/installation/+page.markdoc @@ -31,9 +31,7 @@ For a completely dependency-free installation, the CLI also ships with a conveni Using [Homebrew](https://brew.sh/) ```sh -brew tap appwrite/sdk-for-cli https://github.com/appwrite/sdk-for-cli -brew update -brew install --HEAD appwrite +brew install appwrite ``` or terminal diff --git a/src/routes/pricing/faq.svelte b/src/routes/pricing/faq.svelte index bce8833e8..81747e5c4 100644 --- a/src/routes/pricing/faq.svelte +++ b/src/routes/pricing/faq.svelte @@ -27,6 +27,10 @@ question: 'What happens if I reach a resource limit in my Starter plan?', answer: 'Your project will freeze, and Appwrite Console will continue running in read-only mode. You need to upgrade to Pro, remove resources that exceed their limit, or wait for the next billing cycle, which resets usage limits. Learn more in our docs.' }, + { + question: 'Why does Appwrite ask for payment verification for up to $150?', + answer: 'The Reserve Bank of India (RBI) mandates additional security measures for recurring payments on Indian cards. Appwrite is obligated to ask for verification before billing your card. Appwrite asks for verification for up to $150 in case you use add-ons, but will not charge more than the actual amount used or your budget cap. If you need higher limits, contact us.' + }, { question: 'How can I join the OSS program?', answer: `The OSS program is exclusively for active open-source maintainers using Appwrite Cloud. You can find more information on how to join the program in our announcement blog.` diff --git a/src/routes/privacy/+page.markdoc b/src/routes/privacy/+page.markdoc index 6bb521e6c..080d987ed 100644 --- a/src/routes/privacy/+page.markdoc +++ b/src/routes/privacy/+page.markdoc @@ -74,6 +74,7 @@ What personal data we collect, why we collect it, and how it is used * Specific personal data we collect * - Full name - Email address + - Phone number - IP address - Country - User-agent (info about the browser) @@ -82,7 +83,7 @@ What personal data we collect, why we collect it, and how it is used --- * The purpose of data collection * - To be able to create an account - - To be able to log in + - To be able to log in using two-factor authentication - To be able to enjoy features available to registered users - To collect Informative reason for the administrator. - To better project development (identify reported problem) @@ -94,9 +95,11 @@ What personal data we collect, why we collect it, and how it is used * Consent --- * Third parties with whom we share your personal data -* 3rd party platforms such as for the following purposes: +* 3rd party platforms such as: - Orbit -* 3rd party platforms such as for the following purposes: + - MSG91 (India only) + - Twilio +* 3rd party platforms such as: - Mailgun - Orbit - Hubspot @@ -133,7 +136,7 @@ What personal data we collect, why we collect it, and how it is used - Legitimate interest (e.g. to allow you to purchase Appwrite's swag products) --- * Third parties with whom we share your personal data -* 3rd party platforms such as for the following purposes: +* 3rd party platforms such as: - Shopify - Printful - Paypal @@ -161,15 +164,9 @@ What personal data we collect, why we collect it, and how it is used - Legitimate interest (e.g. send you more information about Appwrite) --- * Third parties with whom we share your personal data -* 3rd party platforms such as for the following purposes: +* 3rd party platforms such as: - Mailgun - Orbit - - MSG91 (India only) - - Twilio - - Telesign - - Textmagic - - Vonage - - Sendgrid --- * Consequences of not providing the personal data * - Cannot add you to our mailing list @@ -201,7 +198,7 @@ What personal data we collect, why we collect it, and how it is used - Legitimate interest (e.g. process your job application) --- * Third parties with whom we share your personal data -* 3rd party platforms such as for the following purposes: +* 3rd party platforms such as: - Homerun - LinkedIn Premium --- @@ -232,7 +229,7 @@ What personal data we collect, why we collect it, and how it is used - Legitimate interest (e.g. respond to a query sent by you) --- * Third parties with whom we share your personal data -* 3rd party platforms such as for the following purposes: +* 3rd party platforms such as: - HelpScout - Docusign (for DPAs) - Typeform @@ -266,7 +263,7 @@ What personal data we collect, why we collect it, and how it is used - Legitimate interest (e.g. process your fund application) --- * Third parties with whom we share your personal data -* 3rd party platforms such as for the following purposes: +* 3rd party platforms such as: - GitHub - OpenCollective - Linear @@ -297,7 +294,7 @@ What personal data we collect, why we collect it, and how it is used * Depending on the context, legitimate interest (B2B marketing), pre-contractual discussions or consent --- * Third parties with whom we share your personal data -* 3rd party platforms such as for the following purposes: +* 3rd party platforms such as: - Hubspot --- * Consequences of not providing the personal data @@ -324,7 +321,7 @@ What personal data we collect, why we collect it, and how it is used * Depending on the context, legitimate interest (B2B marketing), pre-contractual discussions or consent --- * Third parties with whom we share your personal data -* 3rd party platforms such as for the following purposes: +* 3rd party platforms such as: - Social media platforms (e.g. Facebook, GitHub, Twitter, LinkedIn, Discord) --- * Consequences of not providing the personal data diff --git a/src/scss/2-resets/_typography.scss b/src/scss/2-resets/_typography.scss index 2aea348c1..c61447198 100644 --- a/src/scss/2-resets/_typography.scss +++ b/src/scss/2-resets/_typography.scss @@ -20,3 +20,8 @@ body { /* focus styles */ box-shadow: var(--focus-box-shadow); } + +::selection { + color: hsl(var(--aw-color-black)); -webkit-text-fill-color: hsl(var(--aw-color-black)); + background-color: hsl(var(--aw-color-mint-500)); background-clip:revert; -webkit-background-clip:revert; +} \ No newline at end of file diff --git a/src/scss/6-elements/_inline-code.scss b/src/scss/6-elements/_inline-code.scss index f03c3d9bf..62570d97b 100644 --- a/src/scss/6-elements/_inline-code.scss +++ b/src/scss/6-elements/_inline-code.scss @@ -11,5 +11,6 @@ padding-inline: pxToRem(4); padding-block: pxToRem(1); border-radius: pxToRem(4); - font-family: var(--web-font-family-fira-code); + font-family: var(--aw-font-family-fira-code); + word-break: break-word; } diff --git a/src/scss/6-elements/_table.scss b/src/scss/6-elements/_table.scss index 0e5fea9b6..5b0960783 100644 --- a/src/scss/6-elements/_table.scss +++ b/src/scss/6-elements/_table.scss @@ -41,7 +41,27 @@ } } &-head-col { padding:pxToRem(12); min-inline-size:pxToRem(180); } - &-col { padding-block:pxToRem(19); padding-inline:pxToRem(12); } + &-col { + padding-block:pxToRem(19); padding-inline:pxToRem(12); + img { max-inline-size:none; max-block-size:none; } + } + + /* state of table with-remove outer style */ + &-scroll:where(.is-remove-outer-styles) { + border-width:0; + --p-table-header-bg-color: 0 0 0 / 0; + --p-table-row-bg-odd-color: 0 0 0 / 0; + --p-table-row-bg-even-color: 0 0 0 / 0; + border-block-end:solid pxToRem(1) hsl(var(--p-table-border-color)); + + .#{$p}-table { + &-row { } + &-head-col { padding-block-start:pxToRem(8); padding-block-end:pxToRem(16); } + &-col { padding-block:pxToRem(16); } + &-head-col:first-child { padding-inline-start:0; } + &-col:first-child { padding-inline-start:0; } + } + } } diff --git a/src/scss/6-elements/text-tokens/_paragraph-lg.scss b/src/scss/6-elements/text-tokens/_paragraph-lg.scss index 488e6db6b..e9a19000a 100644 --- a/src/scss/6-elements/text-tokens/_paragraph-lg.scss +++ b/src/scss/6-elements/text-tokens/_paragraph-lg.scss @@ -4,7 +4,7 @@ --p-font-size: var(--web-font-size-medium); --p-line-height: var(--web-line-height-md); --p-letter-spacing: var(--web-letter-spacing-tight); - --p-font-weight: var(--web-font-weight-medium); + --p-font-weight: var(--web-font-weight-regular); font-family: var(--p-font-family); font-size: var(--p-font-size); diff --git a/src/scss/7-components/_article.scss b/src/scss/7-components/_article.scss index c1651b93a..927afe39c 100644 --- a/src/scss/7-components/_article.scss +++ b/src/scss/7-components/_article.scss @@ -38,10 +38,9 @@ &-code-snippet { margin-block-end:pxToRem(32); } } &-header { - position:relative; display:flex; flex-wrap:wrap; align-items:center; gap:pxToRem(16); + position:relative; display:flex; flex-wrap:wrap; align-items:start; gap:pxToRem(16); .#{$p}-numeric-badge { - - @media #{$break2open} { position:absolute; transform:translateX(calc(calc(-100% - pxToRem(16) ) * var(--transform-direction) )); } + @media #{$break2open} { position:absolute; inset-block-start:pxToRem(2); transform:translateX(calc(calc(-100% - pxToRem(16) ) * var(--transform-direction) )); } } } &-section { diff --git a/src/scss/abstract/mixins/_numeric-badge.scss b/src/scss/abstract/mixins/_numeric-badge.scss index c36af4362..523a717c8 100644 --- a/src/scss/abstract/mixins/_numeric-badge.scss +++ b/src/scss/abstract/mixins/_numeric-badge.scss @@ -3,16 +3,18 @@ @mixin numeric-badge { --p-numeric-badge-text-color: var(--web-color-pink-500); + --p-numeric-badge-bg-color: calc(var(--web-color-pink-hue) - 1) 68% 85%; color: hsl(var(--p-numeric-badge-text-color)); + background:hsl(var(--p-numeric-badge-bg-color)); display:grid; place-content:center; user-select:none; min-inline-size:pxToRem(24); block-size:pxToRem(24); padding-inline:pxToRem(6); - background:hsl(var(--web-color-pink-500) / 0.08); border:pxToRem(1) solid hsl(var(--web-color-pink-500) / 0.32); border-radius:pxToRem(6); font-size:pxToRem(14); #{$theme-dark} & { --p-numeric-badge-text-color: var(--web-color-greyscale-100); + --p-numeric-badge-bg-color: calc(var(--web-color-pink-hue) - 9) 22% 14%; } } \ No newline at end of file diff --git a/static/images/blog/building-init-giveaway-app/cover.png b/static/images/blog/building-init-giveaway-app/cover.png new file mode 100644 index 000000000..2539bc1c5 Binary files /dev/null and b/static/images/blog/building-init-giveaway-app/cover.png differ diff --git a/static/images/blog/building-init-giveaway-app/discord.png b/static/images/blog/building-init-giveaway-app/discord.png new file mode 100644 index 000000000..c2cd4c489 Binary files /dev/null and b/static/images/blog/building-init-giveaway-app/discord.png differ diff --git a/static/images/blog/building-init-giveaway-app/signin.png b/static/images/blog/building-init-giveaway-app/signin.png new file mode 100644 index 000000000..db68319ef Binary files /dev/null and b/static/images/blog/building-init-giveaway-app/signin.png differ diff --git a/static/images/blog/building-init-giveaway-app/winner.png b/static/images/blog/building-init-giveaway-app/winner.png new file mode 100644 index 000000000..fa6883a77 Binary files /dev/null and b/static/images/blog/building-init-giveaway-app/winner.png differ diff --git a/static/images/changelog/2024-03-07.png b/static/images/changelog/2024-03-07.png new file mode 100644 index 000000000..183bcc3bd Binary files /dev/null and b/static/images/changelog/2024-03-07.png differ diff --git a/static/images/changelog/2024-03-08.png b/static/images/changelog/2024-03-08.png new file mode 100644 index 000000000..de4f5089c Binary files /dev/null and b/static/images/changelog/2024-03-08.png differ diff --git a/static/images/docs/messaging/providers/mailgun/add-mailgun.png b/static/images/docs/messaging/providers/mailgun/add-mailgun.png index 7e9ee9387..6d4128ece 100644 Binary files a/static/images/docs/messaging/providers/mailgun/add-mailgun.png and b/static/images/docs/messaging/providers/mailgun/add-mailgun.png differ diff --git a/static/images/docs/messaging/providers/mailgun/dark/add-mailgun.png b/static/images/docs/messaging/providers/mailgun/dark/add-mailgun.png index 78f0dbb10..a15635a8f 100644 Binary files a/static/images/docs/messaging/providers/mailgun/dark/add-mailgun.png and b/static/images/docs/messaging/providers/mailgun/dark/add-mailgun.png differ diff --git a/static/images/docs/messaging/providers/sendgrid/add-sendgrid.png b/static/images/docs/messaging/providers/sendgrid/add-sendgrid.png index b740233fa..a84e92454 100644 Binary files a/static/images/docs/messaging/providers/sendgrid/add-sendgrid.png and b/static/images/docs/messaging/providers/sendgrid/add-sendgrid.png differ diff --git a/static/images/docs/messaging/providers/sendgrid/dark/add-sendgrid.png b/static/images/docs/messaging/providers/sendgrid/dark/add-sendgrid.png index ed677eed6..a5d924932 100644 Binary files a/static/images/docs/messaging/providers/sendgrid/dark/add-sendgrid.png and b/static/images/docs/messaging/providers/sendgrid/dark/add-sendgrid.png differ diff --git a/static/install/compose b/static/install/compose index 696922783..c9837f8c4 100644 --- a/static/install/compose +++ b/static/install/compose @@ -8,7 +8,7 @@ version: '3' services: traefik: - image: traefik:2.9 + image: traefik:2.11 container_name: appwrite-traefik <<: *x-logging command: @@ -34,7 +34,7 @@ services: - appwrite appwrite: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 container_name: appwrite <<: *x-logging restart: unless-stopped @@ -64,7 +64,6 @@ services: - mariadb - redis # - clamav - - influxdb environment: - _APP_ENV - _APP_WORKER_PER_CORE @@ -72,6 +71,7 @@ services: - _APP_CONSOLE_WHITELIST_ROOT - _APP_CONSOLE_WHITELIST_EMAILS - _APP_CONSOLE_WHITELIST_IPS + - _APP_CONSOLE_HOSTNAMES - _APP_SYSTEM_EMAIL_NAME - _APP_SYSTEM_EMAIL_ADDRESS - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS @@ -99,8 +99,6 @@ services: - _APP_SMTP_USERNAME - _APP_SMTP_PASSWORD - _APP_USAGE_STATS - - _APP_INFLUXDB_HOST - - _APP_INFLUXDB_PORT - _APP_STORAGE_LIMIT - _APP_STORAGE_PREVIEW_LIMIT - _APP_STORAGE_ANTIVIRUS @@ -137,9 +135,8 @@ services: - _APP_EXECUTOR_HOST - _APP_LOGGING_PROVIDER - _APP_LOGGING_CONFIG - - _APP_STATSD_HOST - - _APP_STATSD_PORT - _APP_MAINTENANCE_INTERVAL + - _APP_MAINTENANCE_DELAY - _APP_MAINTENANCE_RETENTION_EXECUTION - _APP_MAINTENANCE_RETENTION_CACHE - _APP_MAINTENANCE_RETENTION_ABUSE @@ -162,7 +159,7 @@ services: - _APP_ASSISTANT_OPENAI_API_KEY appwrite-realtime: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: realtime container_name: appwrite-realtime <<: *x-logging @@ -206,7 +203,7 @@ services: - _APP_LOGGING_CONFIG appwrite-worker-audits: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-audits <<: *x-logging container_name: appwrite-worker-audits @@ -233,7 +230,7 @@ services: - _APP_LOGGING_CONFIG appwrite-worker-webhooks: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-webhooks <<: *x-logging container_name: appwrite-worker-webhooks @@ -256,7 +253,7 @@ services: - _APP_LOGGING_CONFIG appwrite-worker-deletes: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-deletes <<: *x-logging container_name: appwrite-worker-deletes @@ -266,7 +263,7 @@ services: depends_on: - redis - mariadb - volumes: + volumes: - appwrite-uploads:/storage/uploads:rw - appwrite-cache:/storage/cache:rw - appwrite-functions:/storage/functions:rw @@ -312,7 +309,7 @@ services: - _APP_EXECUTOR_HOST appwrite-worker-databases: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-databases <<: *x-logging container_name: appwrite-worker-databases @@ -339,7 +336,7 @@ services: - _APP_LOGGING_CONFIG appwrite-worker-builds: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-builds <<: *x-logging container_name: appwrite-worker-builds @@ -403,7 +400,7 @@ services: - _APP_STORAGE_WASABI_BUCKET appwrite-worker-certificates: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-certificates <<: *x-logging container_name: appwrite-worker-certificates @@ -413,7 +410,7 @@ services: depends_on: - redis - mariadb - volumes: + volumes: - appwrite-config:/storage/config:rw - appwrite-certificates:/storage/certificates:rw environment: @@ -437,7 +434,7 @@ services: - _APP_LOGGING_CONFIG appwrite-worker-functions: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-functions <<: *x-logging container_name: appwrite-worker-functions @@ -474,7 +471,7 @@ services: - _APP_LOGGING_PROVIDER appwrite-worker-mails: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-mails <<: *x-logging container_name: appwrite-worker-mails @@ -502,7 +499,7 @@ services: - _APP_LOGGING_CONFIG appwrite-worker-messaging: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-messaging <<: *x-logging container_name: appwrite-worker-messaging @@ -514,17 +511,23 @@ services: environment: - _APP_ENV - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER - _APP_REDIS_PASS - - _APP_SMS_PROVIDER - - _APP_SMS_FROM + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS - _APP_LOGGING_PROVIDER - _APP_LOGGING_CONFIG + - _APP_SMS_FROM + - _APP_SMS_PROVIDER appwrite-worker-migrations: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: worker-migrations <<: *x-logging container_name: appwrite-worker-migrations @@ -555,7 +558,7 @@ services: - _APP_MIGRATIONS_FIREBASE_CLIENT_SECRET appwrite-maintenance: - image: appwrite/appwrite:1.4.13 + image: appwrite/appwrite:1.5.1 entrypoint: maintenance <<: *x-logging container_name: appwrite-maintenance @@ -588,16 +591,16 @@ services: - _APP_MAINTENANCE_RETENTION_USAGE_HOURLY - _APP_MAINTENANCE_RETENTION_SCHEDULES - appwrite-usage: - image: appwrite/appwrite:1.4.13 - entrypoint: usage - container_name: appwrite-usage + appwrite-worker-usage: + image: appwrite/appwrite:1.5.1 + entrypoint: worker-usage + container_name: appwrite-worker-usage <<: *x-logging restart: unless-stopped networks: - appwrite depends_on: - - influxdb + - redis - mariadb environment: - _APP_ENV @@ -608,9 +611,6 @@ services: - _APP_DB_SCHEMA - _APP_DB_USER - _APP_DB_PASS - - _APP_INFLUXDB_HOST - - _APP_INFLUXDB_PORT - - _APP_USAGE_AGGREGATION_INTERVAL - _APP_REDIS_HOST - _APP_REDIS_PORT - _APP_REDIS_USER @@ -618,11 +618,65 @@ services: - _APP_USAGE_STATS - _APP_LOGGING_PROVIDER - _APP_LOGGING_CONFIG + - _APP_USAGE_AGGREGATION_INTERVAL - appwrite-schedule: - image: appwrite/appwrite:1.4.13 - entrypoint: schedule - container_name: appwrite-schedule + appwrite-worker-usage-dump: + image: appwrite/appwrite:1.5.1 + entrypoint: worker-usage-dump + <<: *x-logging + container_name: appwrite-worker-usage-dump + networks: + - appwrite + depends_on: + - redis + - mariadb + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_USAGE_STATS + - _APP_LOGGING_PROVIDER + - _APP_LOGGING_CONFIG + - _APP_USAGE_AGGREGATION_INTERVAL + + appwrite-scheduler-functions: + image: appwrite/appwrite:1.5.1 + entrypoint: schedule-functions + container_name: appwrite-scheduler-functions + <<: *x-logging + restart: unless-stopped + networks: + - appwrite + depends_on: + - mariadb + - redis + environment: + - _APP_ENV + - _APP_WORKER_PER_CORE + - _APP_OPENSSL_KEY_V1 + - _APP_REDIS_HOST + - _APP_REDIS_PORT + - _APP_REDIS_USER + - _APP_REDIS_PASS + - _APP_DB_HOST + - _APP_DB_PORT + - _APP_DB_SCHEMA + - _APP_DB_USER + - _APP_DB_PASS + + appwrite-scheduler-messages: + image: appwrite/appwrite:1.5.1 + entrypoint: schedule-messages + container_name: appwrite-scheduler-messages <<: *x-logging restart: unless-stopped networks: @@ -645,7 +699,7 @@ services: - _APP_DB_PASS appwrite-assistant: - image: appwrite/assistant:0.2.2 + image: appwrite/assistant:0.4.0 container_name: appwrite-assistant <<: *x-logging restart: unless-stopped @@ -660,7 +714,7 @@ services: <<: *x-logging restart: unless-stopped stop_signal: SIGINT - image: openruntimes/executor:0.4.5 + image: openruntimes/executor:0.4.9 networks: - appwrite - runtimes @@ -705,7 +759,7 @@ services: - OPR_EXECUTOR_STORAGE_WASABI_BUCKET=$_APP_STORAGE_WASABI_BUCKET mariadb: - image: mariadb:10.7 # fix issues when upgrading using: mysql_upgrade -u root -p + image: mariadb:10.11 # fix issues when upgrading using: mysql_upgrade -u root -p container_name: appwrite-mariadb <<: *x-logging restart: unless-stopped @@ -721,7 +775,7 @@ services: command: 'mysqld --innodb-flush-method=fsync' redis: - image: redis:7.0.4-alpine + image: redis:7.2.4-alpine container_name: appwrite-redis <<: *x-logging restart: unless-stopped @@ -744,27 +798,6 @@ services: # volumes: # - appwrite-uploads:/storage/uploads - influxdb: - image: appwrite/influxdb:1.5.0 - container_name: appwrite-influxdb - <<: *x-logging - restart: unless-stopped - networks: - - appwrite - volumes: - - appwrite-influxdb:/var/lib/influxdb:rw - - telegraf: - image: appwrite/telegraf:1.4.0 - container_name: appwrite-telegraf - <<: *x-logging - restart: unless-stopped - networks: - - appwrite - environment: - - _APP_INFLUXDB_HOST - - _APP_INFLUXDB_PORT - networks: gateway: name: gateway @@ -781,5 +814,4 @@ volumes: appwrite-certificates: appwrite-functions: appwrite-builds: - appwrite-influxdb: - appwrite-config: + appwrite-config: \ No newline at end of file