Skip to content

Instantly share code, notes, and snippets.

@gzimbron
gzimbron / startAmplifyConfig.ts
Last active August 5, 2022 15:14
Wait for DataStore Load
import { browser } from '$app/env';
import { PubSub } from '@aws-amplify/pubsub';
import { Amplify, DataStore, Hub } from 'aws-amplify';
import awsmobile from 'src/aws-exports';
export default async function startAmplifyConfig() {
if (!browser) return;
Amplify.configure({ ...awsmobile, ssr: true });
PubSub.configure({ ...awsmobile });
DataStore.configure();
@gzimbron
gzimbron / gist:ea349ef94bbfe9eadaa4f3939e54779d
Last active April 19, 2022 01:22
Migrate Amplify Project to other AWS Account
1.- Delete amplify/team-provider-info.json, src/aws-exports.js
(optional) run amplify configure to setup new aws profile
2.- run amplify init