Skip to content

Commit

Permalink
taking out redirect urls, client secret etc (#196)
Browse files Browse the repository at this point in the history
* taking out redirect urls

* update readme with oauth step
  • Loading branch information
horeaporutiu authored Sep 22, 2023
1 parent ccbff24 commit b8018d7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
3 changes: 0 additions & 3 deletions examples/ai-image-generator/.env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
MIRO_CLIENT_ID=""
MIRO_CLIENT_SECRET=""
MIRO_REDIRECT_URL="http://localhost:3000/api/redirect"
OPENAI_API_KEY=""
31 changes: 13 additions & 18 deletions examples/ai-image-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,34 @@ https://github.com/miroapp/app-examples/assets/10428517/4660d1ab-80b6-4136-9cf6-

# 🏃🏽‍♂️ Run the app locally <a name="run"></a>

1. Rename the `.env.sample` file to `.env` and add in [OpenAI API key](https://platform.openai.com/account/api-keys),
client ID and client secret, and save the file.
1. Rename the `.env.sample` file to `.env` and add in [OpenAI API key](https://platform.openai.com/account/api-keys) and save the file.
2. Run `npm install` to install dependencies.

3. Open the [app manifest editor](https://developers.miro.com/docs/manually-create-an-app#step-2-configure-your-app-in-miro) by clicking **Edit in Manifest**. \
3. Run `npm start` to start developing. \
Your URL should be similar to this example:
```
http://localhost:3000
```
4. Open the [app manifest editor](https://developers.miro.com/docs/manually-create-an-app#step-2-configure-your-app-in-miro) by clicking **Edit in Manifest**. \
In the app manifest editor, configure the app as follows and then `click save`.

```yaml
appName: AI Image Generator
sdkVersion: SDK_V2
sdkUri: http://localhost:3000
redirectUris:
- http://localhost:3000/api/redirect
redirectUriForSdk: http://localhost:3000/api/redirect
scopes:
- boards:read
- boards:write
```
4. Run `npm start`.
Your URL should be similar to this example:

```
http://localhost:3000
```
5. Go back to your app home page, and under the `Permissions` section, you will see a blue button that says `Install app and get OAuth token`. Click that button. Then click on `Add` as shown in the video below. <b>In the video we install a different app, but the process is the same regardless of the app.</b>

Go to the URL and go through the OAuth flow and install the app on a dev team.
> ⚠️ We recommend to install your app on a [developer team](https://developers.miro.com/docs/create-a-developer-team) while you are developing or testing apps.⚠️

> ⚠️ We recommend to install your app on a [developer team](https://developers.miro.com/docs/create-a-developer-team) while you are developing or testing apps.⚠️
https://github.com/miroapp/app-examples/assets/10428517/1e6862de-8617-46ef-b265-97ff1cbfe8bf

5. Go to your developer team, and open your boards.
6. Click on the plus icon from the bottom section of your left sidebar. If you hover over it, it will say `More apps`.
7. Search for your app `AI Image Generator` or whatever you chose to name it. Click on your app to use it, as shown in the video below.
6. Go to your developer team, and open your boards.
7. Click on the plus icon from the bottom section of your left sidebar. If you hover over it, it will say `More apps`.
8. Search for your app `AI Image Generator` or whatever you chose to name it. Click on your app to use it, as shown in the video below. <b>In the video we search for a different app, but the process is the same regardless of the app.</b>

https://github.com/horeaporutiu/app-examples-template/assets/10428517/b23d9c4c-e785-43f9-a72e-fa5d82c7b019

Expand Down
3 changes: 0 additions & 3 deletions examples/ai-image-generator/app-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
appName: AI Image Generator
sdkVersion: SDK_V2
sdkUri: http://localhost:3000
redirectUris:
- http://localhost:3000/api/redirect
redirectUriForSdk: http://localhost:3000/api/redirect
scopes:
- boards:read
- boards:write
2 changes: 1 addition & 1 deletion examples/ai-image-generator/pages/api/openai.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async (req, res) => {
const response = await openai.images.generate({
prompt: prompt,
});
let image_url = response.data[0].url;
const image_url = response.data[0].url;
// send url to front end to display the image
res.status(200).json({
success: true,
Expand Down

1 comment on commit b8018d7

@vercel
Copy link

@vercel vercel bot commented on b8018d7 Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app-examples-wordle – ./examples/wordle

app-examples-wordle-anthonyroux.vercel.app
app-examples-wordle.vercel.app
app-examples-wordle-git-main-anthonyroux.vercel.app

Please sign in to comment.