testimo-widget
v0.0.12
Published
```tsx import "testimo-widget";
Downloads
1,342
Readme
Ejemplo de uso en React + TypeScript
import "testimo-widget";
function App() {
return (
<testimo-widget
organization-id="tu-org-id"
theme="light"
layout="grid"
></testimo-widget>
);
}Con testimo-widget-types instalado, tendrás autocompletado y validación de props en JSX automáticamente.
testimo-widget
The official SDK for integrating Testimo Testimonial Widgets into your web application.
Installation
Install from npm
npm install testimo-widgetTypeScript/JSX Typings
Si usas TypeScript y/o JSX (React, Preact, etc.), instala también los tipos:
npm install testimo-widget-typesEsto habilita el autocompletado y tipado para en proyectos TypeScript/JSX automáticamente.
Documentation
Consulta la documentación y ejemplos en: https://www.npmjs.com/package/testimo-widget
Option: Script Tag (Vanilla JS / Static Sites)
Puedes hostear el sdk.js tú mismo o usar un CDN (cuando esté disponible).
<!-- Si es self-hosted (copiado a tu public folder) -->
<script src="/path/to/sdk.js"></script>Usage
After installation, you can use the <testimo-widget> web component anywhere in your HTML.
Basic Usage
<testimo-widget organization-id="ORG_ID"></testimo-widget>Advanced Configuration
You can configure the widget with the following attributes:
| Attribute | Description | Default |
|-----------|-------------|---------|
| organization-id | Required. The ID of the organization to fetch testimonials for. | - |
| api-url | The base URL of the Testimo API. Use this to override the default production server (e.g. for local development or self-hosting). | http://cubepathhackaton-api-aymrvj-31e30c-108-165-47-144.traefik.me |
| theme | light or dark | light |
| layout | grid or list | grid |
Example with Custom API URL and Dark Theme
<testimo-widget
organization-id="ORG_ID"
api-url="https://api.testimo.app"
theme="dark"
layout="list"
></testimo-widget>React Example
Import the package in tu entry point (por ejemplo,
main.tsxoApp.tsx):import 'testimo-widget';Usa el componente:
export default function Testimonials() { const orgId = import.meta.env.VITE_ORG_ID; return ( <testimo-widget organization-id={orgId} theme="light" layout="grid" ></testimo-widget> ); }
Development
Install dependencies:
npm installBuild the SDK:
npm run build
Publishing to NPM
Login to NPM:
npm loginPublish:
npm publish --access public
