Skip to content

Instantly share code, notes, and snippets.

View dallen4's full-sized avatar
🔥
I just like to build cool things.

Nieky Allen dallen4

🔥
I just like to build cool things.
View GitHub Profile
@dallen4
dallen4 / WEBDEV_ROADMAP.md
Last active March 25, 2024 22:51
Web Developer Roadmap (JS/TS)

Web Dev Roadmap

Application Development

1. HTML, CSS, & JavaScript Fundamentals

  • HTML5, CSS3 & Vanilla JavaScript
  • TypeScript

2. Node.js Basics & ExpressJS

@dallen4
dallen4 / embedded-checkout.ts
Created November 13, 2020 03:27
/embedded-checkout endpoint
import { NextApiRequest, NextApiResponse } from 'next';
import axios, { AxiosResponse } from 'axios';
type RedirectUrlsResponse = {
cart_url: string;
checkout_url: string;
embedded_checkout_url: string;
};
export default async (req: NextApiRequest, res: NextApiResponse) => {
@dallen4
dallen4 / EmbeddedCheckout.tsx
Last active November 13, 2020 03:27
BigCommerce EmbeddedCheckout component
import React from 'react';
import axios from 'axios';
import { embedCheckout } from '@bigcommerce/checkout-sdk';
import useCart from '@bigcommerce/storefront-data-hooks/cart/use-cart';
import { nanoid } from 'nanoid';
export default function EmbeddedCheckout(props: { containerId?: string }) {
const { data } = useCart();
const [checkoutLoaded, setCheckoutLoaded] = React.useState(false);

Keybase proof

I hereby claim:

  • I am dallen4 on github.
  • I am niekya (https://keybase.io/niekya) on keybase.
  • I have a public key ASCYr1uadzpbxejdciNRKVq-Linfkf_eRTLYxVtLRx1q_go

To claim this, I am signing this object: