Adding Private Members to External API

Good afternoon all,

I am attempting to create a function that would automatically take the current registered member and create a membership with my external API. Below is my page and back end code.

I am running into a host of error codes with the latest being “no public key”

Any and all information/feedback is highly appreciated!

Back End Code

 import {fetch} from 'wix-fetch';  
import {wixData} from 'wix-data';

export function postLoyalty() {
 let options ={
 "headers": {        
 "X-Public": "pk_live_ba43e74df464cbf521dd07ee20443ff754c3afc11adc16df2594facb2147cd76"
        }
  }
 const url = 'https://whisqr.com/api/v1.2/user/customer/';
 const key = '<pk_live_ba43e74df464cbf521dd07ee20443ff754c3afc11adc16df2594facb2147cd76>';
     console.log("Url: ");

 return fetch(url, {method: 'post'})
    .then(response => {
 return response.json();
    })
    .then((data) => {
      console.log(data);
 return data;
    });
}

Page Code

import {postLoyalty} from 'backend/Loyalty.jsw';
import {wixData} from 'wix-data';
import wixLocation from "wix-location";
import {myFunction} from 'public/core.js';
import wixUsers from 'wix-users';

$w.onReady(function () {
 let publickey = 'pk_live_ba43e74df464cbf521dd07ee20443ff754c3afc11adc16df2594facb2147cd76';
    myFunction(publickey)
    .then( (response) => {
        console.log(response); //your base64 encoded string
    })});

export function page1_viewportEnter(event) {
 //Add your code for this event here: 
 let email = wixUsers.currentUser.getEmail();
postLoyalty(email)
        .then(LoyaltyInfo => {
            console.log(LoyaltyInfo)
            $w("#text1").text = LoyaltyInfo.Results.Value;
        })
}

.