# Website Integration

This guide is used for the fresh Wodpress Installing, please follow these 5 easy steps and you are good to go (If you are using an existing site, please make sure to back up the database before running the import):

1. Install and activate the  [WooCommerce](https://wordpress.org/plugins/woocommerce/) plugin.
2. Generate the WooCommerce REST API key and save them to your private file for later usage.&#x20;
3. Woocommerce -> settings -> Advanced ->REST API -> Add key

![](https://1714241532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FADxLdkcZJziga7lBQiH4%2Fuploads%2FVS4ziyrGIjpyJuW5phl5%2F1.jpg?alt=media\&token=67223aff-713d-4c3c-8399-3404ef2be6e0)

![](https://1714241532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FADxLdkcZJziga7lBQiH4%2Fuploads%2FBhdqyktzRRS0q2zao6NT%2F2.jpg?alt=media\&token=e229c168-36cf-47d0-9bb3-795bba71b286)

![](https://1714241532-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FADxLdkcZJziga7lBQiH4%2Fuploads%2FNBnehkZVfo3Lp08vZfKt%2F3.png?alt=media\&token=14528fa3-3079-4b4a-98c6-bed6d0a5afaa)

### Plugin Integration

* You need to install the 2 plugins on your Wordpress website
* Download  "[**JWT**](https://wordpress.org/plugins/jwt-auth/) **and variable** ", then upload and active this plugin on your website

#### Enable HTTP Authorization Header&#x20;

* Most shared hosts have disabled the **HTTP Authorization Header** by default.
* To enable this option you’ll need to edit your **.htaccess** file by adding the following:

```
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
```

#### **WPENGINE**

To enable this option you’ll need to edit your **.htaccess** file by adding the following (see [this issue](https://github.com/Tmeister/wp-api-jwt-auth/issues/1)):

```
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
```

**Configure the Secret key**

The JWT needs a **secret key** to sign the token. This **secret key** must be unique and never be revealed.

To add the **secret key**, edit your wp-config.php file and add a new constant called **JWT\_AUTH\_SECRET\_KEY**.

```
define('JWT_AUTH_SECRET_KEY', 'your-top-secret-key');
```

You can use a string from [here](https://api.wordpress.org/secret-key/1.1/salt/)

### App Integration

Now we are going to connect your book store app to your website

1. Open <mark style="color:red;">.env file</mark> Change the URL to your website domain(e.g: [https://demo.com](https://mediapp.umedicart.com/appstore/) ). Then replace the consumer key and consumer secret you created in the previous section (Website Integration).
