How to use the blockstack.AppConfig function in blockstack

To help you get started, we’ve selected a few blockstack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github blockstack / radiks / test / setup.js View on Github external
beforeEach(async () => {
  const userSession = new UserSession({
    appConfig: new AppConfig(['store_write', 'publish_data']),
  });
  configure({
    userSession,
  });
  try {
    await collection.drop();
  } catch (error) {
    // collection doesn't exist
  }
  const appPrivateKey = makeECPrivateKey();
  const blockstackConfig = JSON.stringify({
    version: '1.0.0',
    userData: {
      appPrivateKey,
      username: faker.name.findName(),
      profile: {
github njordhov / react-blockstack / example / src / index.js View on Github external
import React from 'react'
import ReactDOM from 'react-dom';
import { BrowserRouter as Router } from 'react-router-dom'
import App from './App.js'
import ReactBlockstack from 'react-blockstack'
import { Blockstack } from 'react-blockstack/dist/context'
import { AppConfig } from 'blockstack';

// Require Sass file so webpack can build it
import 'bootstrap/dist/css/bootstrap.css';
import'./styles/style.css';

const appConfig = new AppConfig()
const { userSession } = ReactBlockstack(appConfig)

ReactDOM.render(, document.getElementById('root'));
github blockstack-radiks / banter / pages / _app.js View on Github external
const makeUserSession = () => {
  const appConfig = new AppConfig(['store_write', 'publish_data'], process.env.RADIKS_API_SERVER);
  return new UserSession({ appConfig });
};
github pradel / sigle / pages / _app.tsx View on Github external
const makeUserSession = () => {
  const appConfig = new AppConfig(
    ['store_write', 'publish_data'],
    config.appUrl
  );
  return new UserSession({ appConfig });
};
github arinyguedes / safenotes / src / constants.js View on Github external
import { AppConfig } from 'blockstack'

export const appConfig = new AppConfig(['store_write'])

export const HIGHLIGHTS_FILENAME = '{ORIGINAL_PDF_FILE}_highlights.json'
github Graphite-Docs / graphite / src / utils / config.js View on Github external
import { AppConfig } from 'blockstack'

export const appConfig = new AppConfig(['store_write', 'publish_data', 'email']);
github opencollective / opencollective-frontend / src / lib / blockstack.js View on Github external
export function createUserSession() {
  const appConfig = new AppConfig(['email'], window.location.origin, null, '/static/manifest.json');
  const userSession = new UserSession({ appConfig });
  return userSession;
}
github yknl / publik / src / components / App.jsx View on Github external
import React, { Component, Link } from 'react';
import Profile from './Profile.jsx';
import Signin from './Signin.jsx';
import {
  UserSession,
  AppConfig
} from 'blockstack';
import { Switch, Route } from 'react-router-dom'

const appConfig = new AppConfig(['store_write', 'publish_data'])
const userSession = new UserSession({ appConfig: appConfig })

export default class App extends Component {

  constructor(props) {
  	super(props);
  }

  handleSignIn(e) {
    e.preventDefault();
    userSession.redirectToSignIn();
  }

  handleSignOut(e) {
    e.preventDefault();
    userSession.signUserOut(window.location.origin);
github blockstack / blockstack-todos / src / userSession.js View on Github external
import { UserSession, AppConfig } from 'blockstack'

export const appConfig = new AppConfig(['store_write', 'publish_data'])
export const userSession = new UserSession({ appConfig })
window.userSession = userSession
github blockstack / app.co / stores / user / index.js View on Github external
import { UserSession, AppConfig } from 'blockstack'

const host = typeof document === 'undefined' ? 'https://app.co' : document.location.origin
const appConfig = new AppConfig(['store_write'], host)
const userSession = new UserSession({ appConfig })

const initialState = {
  userId: null,
  jwt: null,
  signingIn: false,
  user: null
}

const constants = {
  SIGNING_IN: 'SIGNING_IN',
  SIGNED_IN: 'SIGNED_IN',
  SIGN_IN: 'SIGN_IN',
  SIGNING_OUT: 'SIGNING_OUT'
}