Skip to content

LILA-IT/eRecht24

Repository files navigation

eRecht24

NPM NPM GitHub Workflow Status styled with prettier Quality Gate Status Maintainability Rating Security Bugs Coverage Duplicated Lines (%)

✨ Features

A typescript package to fetch the imprint and privacy policy content from the e-recht24.de API. A premium membership is needed.

Create a project via the project manager and get the api key.

See here for more information.

This package uses caching to reduce the number of requests to the API. The cache is stored in memory and is not persistent. The cache is invalidated after 2 hours. The cache is only available on the server-side. We recommend using this package only on the server-side! You can also add a additional caching layer like Redis.

It currently does not support the Push API from e-recht24.de.

A gatsby plugin is also available here by pgegenfurtner.

This package is not affiliated with e-recht24.de.

🔧 Installation

npm install erecht24
yarn add erecht24

🎬 Getting started

import { ERecht24 } from "erecht24"

const erecht24 = new ERecht24("YOUR API KEY")
const imprint = await erecht24.Imprint
const privacyPolicy = await erecht24.PrivacyPolicy
const privacyPolicySocialMedia = await erecht24.PrivacyPolicySocialMedia

📜 API

Only your API Key is needed and you can use the corresponding properties to get the content. (see above) It is recommended to create the instance once and use the getter functions.

There are also static functions available. With these functions the cache is not used. We do not recommend using these functions.

import { ERecht24 } from "erecht24"

const imprint = await ERecht24.getImprint("YOUR API KEY")
const privacyPolicy = await ERecht24.getPrivacyPolicy("YOUR API KEY")
const privacyPolicySocialMedia =
	await ERecht24.getPrivacyPolicySocialMedia("YOUR API KEY")

🥂 License

MIT