Admin UI App
A KeystoneJS App which provides an Admin UI for content management.
Usage
const { Keystone } = require('@keystonejs/keystone');
const { GraphQLApp } = require('@keystonejs/app-graphql');
const { AdminUIApp } = require('@keystonejs/app-admin-ui');
const authStrategy = keystone.createAuthStrategy({ ... });
...
module.exports = {
  keystone: new Keystone(),
  apps: [
    new GraphQLApp(),
    new AdminUIApp({
        adminPath: '/admin',
        authStrategy,
    }),
  ],
};
Config
| Option | Type | Default | Required | Description | 
|---|---|---|---|---|
| adminPath | String | /admin | false | The path of the Admin UI. | 
| apiPath | String | /admin/api | false | The path of the API provided to the Admin UI. | 
| graphiqlPath | String | /admin/api | false | The path of the graphiql app, an in-browser IDE for exploring GraphQL. | 
| authStrategy | Object | null | false | See Authentication Guides | 
| pages | Array | null | false | |
| enableDefaultRoute | Bool | false | false | If enabled, the path of the Admin UI app will be set to /. | 
| schemaName | String | public | false | |
| isAccessAllowed | Function | true | false | Controls which users have access to the Admin UI. | 
isAccessAllowed
This function takes the same arguments as a shorthand imperative boolean access control. It must return either true or false.
If omitted, all users with accounts will be able to access the Admin UI. The example below would restrict access to users with the isAdmin permission.
Usage
new AdminUIApp({
  /*...config */
  isAccessAllowed: ({ authentication: { item: user, listKey: list } }) => !!user && !!user.isAdmin,
}),