Giter VIP home page Giter VIP logo

mothers-day-2024's Introduction

Made 4 Mom - a Mother's Day card project

This repo is home to documentation and an example plugin for https://made4mom.com -- a WebAssembly plugin greeting card proejct.

Making a card

All of these instructions assume you already have a guest account after filling out the invitation page on https://made4mom.com... if not, please do that first!

Using the xtp CLI

  1. Download the xtp CLI:
curl https://static.dylibso.com/cli/install.sh | sudo sh

Once you've accepted your invitation from Made4Mom via email, you will be logged into the browser application at https://xtp.dylibso.com -- XTP is a plugin life-cycle management platform that you will interact with behind the scenese to test & push a greeting card plugin.

If you're indeed logged in, you can authenticate via the xtp CLI and can create your plugin.

xtp auth login

Follow the steps, and by the end you should see your information when running:

xtp auth whoami

Generate a plugin scaffold

xtp plugin init

Then, take a look at the example plugin in this repo for some inspiration. You'll see that there are 3 functions you need to implement.

These functions coform to the following interface:

type I32 = number;

declare module "main" {
  // sets plugin output as HTML to be rendered into the front of the greeting card.
  export function create_front_layout(): I32;

  // sets plugin output as HTML to be rendered into the inside of the greeting card.
  export function create_card_layout(): I32;

  // enables your plugin to handle a POST request to itself, so you can add some state and interactivity to your card.
  // the input to this plugin is the body of the POST request.
  export function handle_post_request(): I32;
}

You don't have to write your plugin in TypeScript -- you can use any of the Extism PDK languages to write a plugin and compile it to WebAssembly.

Just make sure the xtp.toml in the root of your project can locate the plugin binary .wasm file so when you run xtp plugin push, the file is uploaded and processed accordingly.

Need help?

Come chat with us on the Extism Discord!

mothers-day-2024's People

Contributors

nilslice avatar

Watchers

Benjamin Eckel avatar zach avatar Gavin Hayes avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.