Skip to content

davisshaver/wp-rainbow

Repository files navigation

RainbowKit Login (Web3 Integration for Sign-In With Ethereum)

PHPUnit Tests

Providing a Sign-In With Ethereum experience for WordPress using RainbowKit.

Want to try it out? Head here.

Installation

The recommended way to install RainbowKit Login is downloading the ZIP file from the most recent release.

Development

Before you begin, make sure you have Composer and Yarn available.

  1. Clone the repository.

    git clone https://github.com/davisshaver/wp-rainbow.git

  2. Change into the directory.

    cd wp-rainbow

  3. Install Composer dependencies.

    composer install

  4. Install Node dependencies with Yarn.

    yarn install

  5. Build the JS files.

    yarn build

Note: This plugin requires GMP to be available on the server.

Actions

wp_rainbow_validation_failed - Fires when validation fails.

wp_rainbow_user_created - Fires when user created.

wp_rainbow_user_updated - Fires when user updated.

wp_rainbow_user_login - Fires when user logs in.

Filters

Find reference implementations of all filters in example plugin here.

wp_rainbow_nonce_life - Filter amount of time before nonce expires.

wp_rainbow_role_for_address - Filter role granted to a specific address on sign-in.

wp_rainbow_should_update_roles - Filter whether roles should be set.

wp_rainbow_rpc_url - Filter RPC URL to override settings value.

wp_rainbow_rpc_url_mainnet - Filter mainnet RPC URL to override settings value.

wp_rainbow_infura_id - Filter Infura ID to override settings value.

wp_rainbow_infura_network - Filter Infura network to override settings value.

wp_rainbow_redirect_url - Filter login redirect URL.

wp_rainbow_should_update_roles - Filter whether roles should be set.

wp_rainbow_should_disable_user_role_updates_on_login - Filter whether roles should be updated on login.