Skip to content

Instantly share code, notes, and snippets.

View hanakslr's full-sized avatar

Hana Kessler hanakslr

View GitHub Profile
@hanakslr
hanakslr / faraday_api_example.ts
Created January 26, 2023 17:24
faraday-js sample
import { Configuration, FaradayClient } from "@faradayio/faraday-js";
const configuration = new Configuration({
basePath: window.location.origin,
accessToken: "Bearer abcd",
});
const faraday = new FaradayClient(configuration);
const sample = async () => {

Keybase proof

I hereby claim:

  • I am hanakslr on github.
  • I am hanakessler (https://keybase.io/hanakessler) on keybase.
  • I have a public key ASDXVTXoaHq57eKxFfS1rS9rDi63lEtjbIheRxOKqyuxAgo

To claim this, I am signing this object:

@hanakslr
hanakslr / index.d.ts
Last active February 5, 2021 18:32
react-native-qonversion typings
declare module "react-native-qonversion" {
export default class Qonversion {
static setProperty(property: Property, value: string): void;
static launchWithKey(key: string, observerMode?: Boolean): Promise<LaunchResult>;
static setUserProperty(property: string, value: string): void;
static setUserId(userId: string): void;
static addAttributionData(data: Object, provider: Provider): void;
static checkPermissions(): Promise<Map<string, Permission>>;
static purchase(productId: string): Promise<Map<string, Permission>>;
static updatePurchase(
@hanakslr
hanakslr / graphql.js
Created July 16, 2020 21:07
Typedefs for simple mutation to create new Stripe customer
const typeDefs = gql`
type StripeCustomer {
stripe_cust_id: String!
}
type Mutation {
createStripeCustomer(name: String!, email: String!): StripeCustomer!
}
`;
@hanakslr
hanakslr / graphql.js
Created July 16, 2020 21:02
Include Stripe
const Stripe = require("stripe");
@hanakslr
hanakslr / graphql.js
Last active July 16, 2020 21:12
GraphQL mutation for creating a Stripe customer
const resolvers = {
Mutation: {
createStripeCustomer: async (_parent, args, context) => {
const stripe = Stripe(context.headers.stripe_api_key);
const customer = await stripe.customers.create({
name: args.name,
email: args.email,
});
return { stripe_cust_id: customer.id };
@hanakslr
hanakslr / graphql.js
Created July 16, 2020 20:59
Simple Apollo server with GraphQL mutation for Stripe
const { ApolloServer, gql } = require("apollo-server-lambda");
const Stripe = require("stripe");
const typeDefs = gql`
type StripeCustomer {
stripe_cust_id: String!
}
type Mutation {
createStripeCustomer(name: String!, email: String!): StripeCustomer!