https://github.com/johannschopplich/nuxt-reapit
🏘️ Reapit integration for Nuxt
https://github.com/johannschopplich/nuxt-reapit
Last synced: 6 months ago
JSON representation
🏘️ Reapit integration for Nuxt
- Host: GitHub
- URL: https://github.com/johannschopplich/nuxt-reapit
- Owner: johannschopplich
- License: mit
- Created: 2023-10-14T19:48:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T20:10:05.000Z (almost 2 years ago)
- Last Synced: 2025-04-02T13:18:47.850Z (6 months ago)
- Language: TypeScript
- Size: 242 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# nuxt-reapit
[](https://www.npmjs.com/package/nuxt-reapit)
> Reapit integration for [Nuxt](https://nuxt.com).
- [✨ Release Notes](https://github.com/johannschopplich/nuxt-reapit/releases)
## Setup
```bash
# pnpm
pnpm add -D nuxt-reapit# npm
npm i -D nuxt-reapit# yarn
yarn add -D nuxt-reapit
```## Usage
To get started, add the `nuxt-reapit` module to your `nuxt.config.ts`:
```ts
// `nuxt.config.ts`
export default defineNuxtConfig({
modules: ['nuxt-reapit']
})
```Set your Reapit Connect credentials by adding them to your project's `.env` file:
```ini
REAPIT_CONNECT_CLIENT_ID=
REAPIT_CONNECT_CLIENT_SECRET=
# The following are optional and default to the Reapit production URLs
REAPIT_CONNECT_API_URL=https://connect.reapit.cloud
REAPIT_PLATFORM_API_URL=https://platform.reapit.cloud
```Instead of the `.env` file, you can also set the credentials using the `reapit` module configuration:
```ts
// `nuxt.config.ts`
export default defineNuxtConfig({
modules: ['nuxt-reapit'],reapit: {
connect: {
clientId: '',
clientSecret: '',
// Default values
apiUrl: 'https://connect.reapit.cloud',
},
platform: {
// Default values
apiUrl: 'https://platform.reapit.cloud',
},
}
})
```Finally, you can use the `useReapit` composable to fetch data from the Reapit Platform API:
```ts
// Fetch all properties with images
const { data } = await useReapit('properties', {
customerId: 'SBOX',
query: {
embed: 'images',
marketingMode: 'selling',
},
})const properties = computed(() => data.value?._embedded || [])
```> [!NOTE]
> Don't forget to set your `customerId`. It becomes available to view after a customer has chosen to install your application.## 💻 Development
1. Clone this repository
2. Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
3. Install dependencies using `pnpm install`
4. Run `pnpm run dev:prepare`
5. Start development server using `pnpm run dev`## License
[MIT](./LICENSE) License © 2023-PRESENT [Johann Schopplich](https://github.com/johannschopplich)